Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    GŁtkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •