Skip to content

Commit

Permalink
Avoid load document error in IE8 (rel aFarkas#93)
Browse files Browse the repository at this point in the history
Wait for onload event to call shivPrint function.
This ensures the document is set and initialized, and avoids
random error when accessing document.namespaces
  • Loading branch information
juafrlo committed Feb 26, 2013
1 parent 5b30398 commit 555462b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/html5shiv-printshiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@
html5.type += ' print';
html5.shivPrint = shivPrint;

// shiv for print
shivPrint(document);
// Wait for onload to avoid load document error in IE8
window.onload = function() {
// shiv for print
shivPrint(document);
}


}(this, document));

0 comments on commit 555462b

Please sign in to comment.