In Internet Explorer, when onreadystatechange is fired, and readystate switches to complete, is that the same time onload event triggers? Have all the requests completed by this time?
In Internet Explorer, when onreadystatechange is fired, and readystate switches to complete, is that
Share
document.onreadystatechangeis typically more optimal thanwindow.onloadas it fires before all external resources such as images are loaded. However, it’s not well supported at the moment (but if you’re only concerned with IE, then it’s not a problem).See: https://developer.mozilla.org/en/DOM/document.onreadystatechange
Or, for IE: http://msdn.microsoft.com/en-us/library/ms536957(v=vs.85).aspx