I have a page which runs various javascript code, including calling setTimeout()
. If a user clicks a link to navigate to another page, at what point does the javasc
One possible solution would be to stop the click event, fire away an asynchronous call and resume the default event when the result from the ajax call has been processed. Or, if possible, you could handle the processing on the server in which case you wouldn't even need to stop the default event - just fire your asynchronous call.
In answer to your question, I agree with Jack that the script would stop run after the onunload event.
Hope this hepls.