homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

adding setTimeout to doby onload command

 5:01 pm on Oct 2, 2002 (gmt 0)

Some time ago, with a lot help from webmasterWorld Ōbrain trustÕ, I implemented the following script

<body onload="if (window.opener && !window.opener.closed){window.opener.parent.location='back_cover.html';}"

The script runs in a popup window and it changes the contents in the window that launched the popup. It works great. However, here is my problem. The onload works when all the html is loaded but IÕm loading a flash movie, which onload doesnÕt recognize, this results in the new contents and my flash movie loading at the same time, which slows down the whole process.

IÕve been trying to incorporate ŌsetTimeoutÕ command to delay the loading for 20 seconds but canÕt get it to work.

Any help writing this script much appreciated.




 5:32 pm on Oct 2, 2002 (gmt 0)

Have you tried:

setTimeout("if (window.opener && !window.opener.closed){window.opener.parent.location='back_cover.html';})", 20000);

You could also use Flash to execute the script when it is done loading using FScommand.


 6:17 pm on Oct 2, 2002 (gmt 0)

thanks korkus but it's still not working for me.

I like the FScommand but alas the 'flashmaster' couldn't live up to his name and I can't get that to work either.


 6:28 pm on Oct 2, 2002 (gmt 0)

Have you tried the code in a script tag and not in the onload?

function waitABit(){
setTimeout("popMe()", 20000);

function popMe(){
if (window.opener && !window.opener.closed){window.opener.parent.location='back_cover.html';}


<body onLoad="waitABit()">

With Flash

Have an action on your first frame that check to see if the last frame is loaded. Once it triggers you want to

Get URL ("javascript:popMe()")


 1:44 pm on Oct 3, 2002 (gmt 0)

Hi Korkus,

you have made my day, it works a treat.

thank you


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved