homepage Welcome to WebmasterWorld Guest from 54.204.67.26
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
adding setTimeout to doby onload command
flashmastermak




msg:582358
 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.

Mak

 

korkus2000




msg:582359
 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.

flashmastermak




msg:582360
 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.

korkus2000




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

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

<script>
function waitABit(){
setTimeout("popMe()", 20000);
}

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

</script>

<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()")

flashmastermak




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

Hi Korkus,

you have made my day, it works a treat.

thank you

Mak

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved