Synchronize on multiple of event notifications

S

sfeher

Hi All,

I need to synchronize on multiple event notifications.

After loading a number of scripts in my page ( using
document.createElement('script') / appendChild ) I get a notification
for each one after it is loaded.
What I need before going further is to wait until the last notification
was received.

Somethiing like a non-CPU intensive JavaScript wait loop..

Any ideas ?!

Regards
Sebastian
 
R

Randy Webb

(e-mail address removed) said the following on 6/28/2006 11:46 AM:
Hi All,

I need to synchronize on multiple event notifications.

After loading a number of scripts in my page ( using
document.createElement('script') / appendChild ) I get a notification
for each one after it is loaded.
What I need before going further is to wait until the last notification
was received.

Somethiing like a non-CPU intensive JavaScript wait loop..

Any ideas ?!

In the last script block, on the last line, have a function call that
calls a function to continue processing:

lastFile.js:

//data here

someFunctionInThePageToContinueProcessing()

Or, less reliably, have each file increment a counter and then you set
up a "checker function" that will check the counter and when it reaches
the number of files you are loading, it continues.
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top