javascript - Browser support for readyState interactive? -


i'm building web app has work on old browsers (ie 8, firefox 20, etc).

can rely on document.readystate being interactive , complete working correctly?

basically, want perform action after dom loads, perform action if has loaded. this:

if (document.readystate == 'interactive' ||     document.readystate == 'complete') {   doaction(); } else {   document.onready = doaction; } 

i found that, applescript 2.5 , safari 10.0.3, had use following construction:

do javascript "document.location.href = \"" & anewurl & "\""         repeat 5 times     if ¬         ((do javascript "document.location.href") = anewurl) , ¬         ((do javascript "document.readystate") = "complete") ¬             return     delay 3 end repeat error... 

because readystate showed "complete" old url right after first line.


Comments