I want to detect when the document has just started to load, so that I can make an ajax call right away…which will determine whether I need to navigate to another page or not. I don’t want to wait for the entire page to load before firing the ajax, and then, possibly navigating away from this page on the basis of the result of this ajax request.
Share
just put code in the
headof the document, no?or at the start of the body.