I create an empty array and pass it to some other function that will display it on the page. (its empty yet) I want to wait 5 seconds and load some elements to the array, which will be displayed onto the page. But don't how to implment it. I tried this but failed:
and I called preload in body onload event. What error/exception you are getting?
Joined: May 12, 2005
What I would like to do is like the code showing below. The page will show the 1st element of the array first, which is 'undefined', after 5 seconds, I want add something to the array, but the page itself does not change. How should I change to make it work? Thanks.
Joined: May 24, 2003
setTimeout is not a blocking call. You need to rewrite something similar to this: