JavaScript: Stop while loop when an event occurs -
i want while loop stop when "load" event occurs.
this executes while loop after event occurs:
window.addeventlistener("load", function() { while (...) {...} });
i wish in pure javascript (not using jquery or other library).
("load" event: page loaded; document.readystate == "complete"
: page not loaded.)
window.addeventlistener("load", function() { while (document.readystate !== "complete") { //do whatever } });
Comments
Post a Comment