Please Wait for Javascript Processes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Foong

    Please Wait for Javascript Processes

    Hi all,

    I have a webpage that does a long process in javascript. I am opening
    a popup page while this process is running. The only problem is, the
    popup page doesnt finish loading and the popup window is kinda like
    stalled while the mainpage goes about finishing the long process.

    How can I make sure that the popup finish loading everything before
    the long process starts?

    PS: I do not wished to use timeouts because the process might not be
    long in all instances and if that is the case, I dont want a delay
    before the popup is closed.

    HELP ME!!
  • Douglas Crockford

    #2
    Re: Please Wait for Javascript Processes

    > I have a webpage that does a long process in javascript. I am opening[color=blue]
    > a popup page while this process is running. The only problem is, the
    > popup page doesnt finish loading and the popup window is kinda like
    > stalled while the mainpage goes about finishing the long process.
    >
    > How can I make sure that the popup finish loading everything before
    > the long process starts?
    >
    > PS: I do not wished to use timeouts because the process might not be
    > long in all instances and if that is the case, I dont want a delay
    > before the popup is closed.[/color]

    Put the long process code in a function and pass the function to setTimeout. You
    can give it a delay time of 0, so it won't slow things down. That will allow the
    current sequence to complete so that the popup can be displayed.



    Comment

    Working...