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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -