Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-03-2011, 02:43 PM   PM User | #1
pete3652
New to the CF scene

 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pete3652 is an unknown quantity at this point
Arrow Trying to delay new window loads for performance

Hi guys - I am building an html/javascript web page and I am using prototype windows to display various stuff. I currently have 25 new prototype windows loading up when you open up the web page and as you can imagine it takes 15-20 seconds before any of the windows content begins to appear.

Does anyone know of a way to use javascript to only load say 3 new prototype windows and display them on the page and then like 5 seconds later load the next 3 and so on?

I have been messing around with this:
setTimeout("launchGroup2()", 5000);
but no luck yet. I know EJB programming but never learned much Javascript. It seems like all the functions in my .js file are executed when I include it in my html page and it doesn't return control to the browser until everything in the .js file completes executing. Am I missing something?

Thanks for any advise!
pete3652 is offline   Reply With Quote
Old 02-03-2011, 05:23 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
That's what you use events and callbacks for. If you don't know how long a window will take to load, setTimeout is a flawed approach. I don't know anything about Prototype windows, but I'm pretty sure they provide some sort of callback option to execute code once the window is loaded.
venegal is offline   Reply With Quote
Reply

Bookmarks

Tags
ajax, delay, performance, prototype, window

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:11 PM.


Advertisement
Log in to turn off these ads.