Make IE wait for readyState == complete since interactive seem to be able to be posted before the page is actually all there. Should resolve issue #133.

This commit is contained in:
Davide P. Cervone 2012-08-19 14:29:52 -04:00
parent 0236ee5a54
commit c703d5fc4e
2 changed files with 8 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -1954,7 +1954,13 @@ MathJax.Hub.Startup = {
onLoad: function () {
var onload = this.onload =
MathJax.Callback(function () {MathJax.Hub.Startup.signal.Post("onLoad")});
if (document.body && document.readyState && document.readyState !== "loading") {return [onload]}
if (document.body && document.readyState)
if (MathJax.Hub.Browser.isMSIE) {
// IE can change from loading to interactive before
// full page is ready, so go with complete (even though
// that means we may have to wait longer).
if (document.readyState === "complete") {return [onload]}
} else if (document.readyState !== "loading") {return [onload]}
if (window.addEventListener) {
window.addEventListener("load",onload,false);
if (!this.params.noDOMContentEvent)