<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>RE: [Javascript] replace</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>IMHO you are starting out with two strikes against you: 1. Flash; 2. Frames ;-)</FONT>
</P>

<P><FONT SIZE=2>Having said that, try putting your popup() and&nbsp; eraseHistory() functions in the &lt;HEAD&gt; of the main page that defines the frameset.</FONT></P>
<BR>

<P><FONT SIZE=2>Bob Filipiak</FONT>
<BR><FONT SIZE=2>(Contractor) </FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: matthew garland [<A HREF="mailto:mgarland@rpa.com">mailto:mgarland@rpa.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, October 23, 2001 3:44 PM</FONT>
<BR><FONT SIZE=2>To: javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>Subject: [Javascript] replace</FONT>
</P>
<BR>

<P><FONT SIZE=2>Hi,</FONT>
</P>

<P><FONT SIZE=2>Learning a little Javacript beyond &quot;window.open&quot;. Hope you can help. </FONT>
<BR><FONT SIZE=2>This is the set up: I have two frames on a page: &quot;home&quot; with a home.html page, and &quot;dummy&quot; 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. </FONT></P>

<P><FONT SIZE=2>When I want to communicate between Flash and the window, only one action is supported in all 4.0+ browsers--the link or Flash &quot;getURL()&quot; command. So the workaround is this: the Flash calls a page into the &quot;dummy&quot; frame (getURL (&quot;aPopUP.html&quot;,&quot;dummy&quot;//to target the frame), which in turn executes Javascript within the onload handler. </FONT></P>

<P><FONT SIZE=2>This works like a charm, and I use it to call pop ups from the Flash movie.</FONT>
</P>

<P><FONT SIZE=2>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 &quot;onload&quot;--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. </FONT></P>

<P><FONT SIZE=2>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 &quot;dummy.html,&quot; there would be no history and the back button would take you right out of the site, with no retread of the pop ups. </FONT></P>

<P><FONT SIZE=2>but I can't get the code to work: </FONT>
<BR><FONT SIZE=2>{//in the header of each dummy page</FONT>
</P>

<P><FONT SIZE=2>function popUp () </FONT>
<BR><FONT SIZE=2>window.open (page,window,features)</FONT>
</P>

<P><FONT SIZE=2>}</FONT>
</P>

<P><FONT SIZE=2>function eraseHistory() {</FONT>
</P>

<P><FONT SIZE=2>setTimeout ('location.replace('dummy.html')',1000)</FONT>
</P>

<P><FONT SIZE=2>}</FONT>
</P>

<P><FONT SIZE=2>//in the onload handler of the dummy page</FONT>
</P>

<P><FONT SIZE=2>onload=&quot;popUp();eraseHistory()&quot;</FONT>
</P>

<P><FONT SIZE=2>Not only does this not work, it makes the pop Up not work! Is there something wrong with my code? I know nothing.Help!</FONT>
</P>

<P><FONT SIZE=2>Thanks in advance</FONT>
</P>

<P><FONT SIZE=2>Matt</FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Javascript mailing list</FONT>
<BR><FONT SIZE=2>Javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2><A HREF="http://www.LaTech.edu/mailman/listinfo/javascript" TARGET="_blank">http://www.LaTech.edu/mailman/listinfo/javascript</A></FONT>
</P>

</BODY>
</HTML>