[Javascript] replace

Filipiak, Bob (Contractor) filipiab at atsc.army.mil
Wed Oct 24 08:19:34 CDT 2001


IMHO you are starting out with two strikes against you: 1. Flash; 2. Frames
;-)

Having said that, try putting your popup() and  eraseHistory() functions in
the <HEAD> of the main page that defines the frameset.


Bob Filipiak
(Contractor) 










-----Original Message-----
From: matthew garland [mailto:mgarland at rpa.com]
Sent: Tuesday, October 23, 2001 3:44 PM
To: javascript at LaTech.edu
Subject: [Javascript] replace


Hi,

Learning a little Javacript beyond "window.open". Hope you can help. 
This is the set up: I have two frames on a page: "home" with a home.html
page, and "dummy" with a blank dummy.html page. The home frame has a Flash
movie embedded in it. The dummy frame is an invisible one-pixel frame. 
When I want to communicate between Flash and the window, only one action is
supported in all 4.0+ browsers--the link or Flash "getURL()" command. So the
workaround is this: the Flash calls a page into the "dummy" frame (getURL
("aPopUP.html","dummy"//to target the frame), which in turn executes
Javascript within the onload handler. 
This works like a charm, and I use it to call pop ups from the Flash movie.

But here's the problem: when the user tries to leave the site, and hits the
back button, all the pop ups come up again, because the back button is
retreading the history of the window. Each dummy page is called up again,
and "onload"--the pop up comes up. YRRECH! Annoying, especially since my
site is a FLash site that loads a lot of long text in pop ups. 
I only know enough Javascript to open pop ups, but my reseach has led me to
at least one solution: if every time the dummy pages loaded, they fired off
the pop ups, then waited a second and then used the replace command to
return the location of the dummy frame back to the original "dummy.html,"
there would be no history and the back button would take you right out of
the site, with no retread of the pop ups. 
but I can't get the code to work: 
{//in the header of each dummy page

function popUp () 
window.open (page,window,features)

}

function eraseHistory() {

setTimeout ('location.replace('dummy.html')',1000)

}

//in the onload handler of the dummy page

onload="popUp();eraseHistory()"

Not only does this not work, it makes the pop Up not work! Is there
something wrong with my code? I know nothing.Help!

Thanks in advance

Matt
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20011024/8601e13d/attachment.htm>


More information about the Javascript mailing list