Click to See Complete Forum and Search --> : javascript / IE windows problem
Jorn Ebner
04-11-2003, 06:37 AM
my website consists of a series of windows with flash movies which trigger off new windows with flash movies, all with the help of javascript.
my initial flash movie opens two new windows with the help of javascript. this works fine in IE + NS for Mac. In Windows, however, the browser doesn't open one of the windows, the first one that my getURL command is asking for.
I have tried variations. The first one had the first window called on frame one the second on frame two. Variation two had both windows called in one Javascript command. Variation three left some time for the sluggish browser to open both windows (a distance of 9 frames between the two getURL commands). In addition I renamed the html file from exit.html to one that I thought wasn't problematic in terms of security.
Strangely, at a later stage, the browser does NOT have a problem with two windows (different ones) to be opened at the same time. (for viewing reference: http://www.leifcodices.info)
Any suggestions, why that is happening?
Jorn
DFWStudios
04-11-2003, 08:08 PM
Our experience has shown that specific naming conventions and handling are required for the the JavaScript to access the correct window and differentiate from which one is the most top state of the desktop.
Depending on configurations at both ends, not all OS and Browsers allow for the repopulating of an existing window with a new URL by just activating the window you custom named for code control purposes.
You may need to take it to another level and use something like the following setup.
Name the pop up window something unique and standardized:
window.open(URL, "myWindowOne");
* url being a variable passed to the function to open the new window
Then when you want to access that window, while you are first in the new pop up window (this script would reside on the resulting page being loaded into the new custom named window)
var MyWin1 = self.window;
Now, after that process, from your original movie source and HTML page or any other one, you can access the methods and properties by this:
MyWin1.location.assign("NEW URL");
MyWin1.location.replace("NEW URL");
MyWin1.close();
MyWin1.focus();
MyWin1.blur();
MyWin1.refresh();
MyWin1.reload();
The list goes on and on...and to load a new page without just relying on the users probably out of date browser handling do this...
MyWin1.location.replace("NEW URL");
* then start a short setTimeout("NAME OF FUNCTION",5000); line that accesses a new function you call to do this:
MyWin1.refresh(); or MyWin1.reload(); etc...
this ensures the window loads and refreshes... and the fact that you have control over the window now as an object variable gives you DOM control rights and permissions to close, open, redirect, refresh, size, strip rights and properties etc...
Try my site and you will see the control you can have over windows, even multiple control all simultaneously.
http://www.dfwstudios.com
We have a custom index page that pops up two new windows, one with encryption variables and the other for the intro movie..then the intro movie utilizes control set by the initial index page code and controls access to the main site within one of the primary popped up windows...then the variables window is assigned by the third window the about:blank to erase the encryption keys and the rest is in browser memory going forward...
Notice if you go back to any other window link in my site, the script catches this and redirects to the home page so that the chain of events to make our site run the way we designed is kept in its integrity and keeps direct access to a page that requires a custom pop up window to call it from the server instead of anywhere in the address bar of anyone's browser. You may not want to go to this length, but for our purposes it works great and keeps the visitors with bad browsers and quirky OS systems notified at the beginning of the site instead of when their computer locks up when accessing a highly developed scripted page in Flash/php and JavaScript combinations.
Hope this helps. I attached our browser sniffer file too for you so you can more accurately control who gets where and how far into your scripts when accessing your site.
Musicman
04-12-2003, 03:00 AM
Hi,
in fact your site pops up this message
Since you are not using a Mac or Windows based OS and non-IE compatible browser, you will not be able to view this website correctly. Consider upgrading to a later version browser
I am using Mozilla 1.1 on linux. Do you want to say that Moz 1.3 or 1.4 would work without the nasty messge? In any case I do not want to downgrade from linux to windows :(
BTW: I do appreciate that it is possible to view the site after the popup appears ... there are a few sites around with flash sniffers that send visitors back even if they click "I have correct player"
Musicman
DFWStudios
04-15-2003, 11:33 PM
How correct you are! Most of the 'other' OS combos and a Mozilla compatible browser still show the site without isues. The nasty message is a little over kill, though. Maybe we will reword it to be more specific to those OS systems that we target as being 'potential' issues, so that we don't hack off any one else. Thanks for the tip though...it's not like we have every OS and browser combination in our lab room to test this stuff in the real world. That's where folks like you come in real handy to let us know of the 'issue' that's not really an issue after all. Thanks ;)
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.