Please Wait for Javascript Processes

M

Mark Foong

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!!
 
D

Douglas Crockford

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.

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.

http://www.crockford.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top