You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using html5shiv in a project, and I have random errors here:
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces, ------> Here I got an error
ownerWindow = ownerDocument.parentWindow;
....
This function is called from:
shivPrint(document);
The javascript console throws this info about the error:
'unspecified error' in line...
It seems the ownerDocument (the document) is not set or initialized correctly at this point, and it happens only sometimes.
To avoid this error, I wait to window.onload event to call this function.
// Wait for onload to avoid load document error in IE8
window.onload = function() {
// shiv for print
shivPrint(document);
}
The text was updated successfully, but these errors were encountered:
juafrlo
added a commit
to juafrlo/html5shiv
that referenced
this issue
Feb 26, 2013
Wait for onload event to call shivPrint function.
This ensures the document is set and initialized, and avoids
random error when accessing document.namespaces
Thanks for your bugreport. I will look into this soon. The onload event might be to late. We could try to use a IE-only domcontentready method. Additionally window.onload = your function, can be overwritten or overwrites other event handler. It's not save.
I'm using html5shiv in a project, and I have random errors here:
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces, ------> Here I got an error
ownerWindow = ownerDocument.parentWindow;
....
This function is called from:
shivPrint(document);
The javascript console throws this info about the error:
'unspecified error' in line...
It seems the ownerDocument (the document) is not set or initialized correctly at this point, and it happens only sometimes.
To avoid this error, I wait to window.onload event to call this function.
// Wait for onload to avoid load document error in IE8
window.onload = function() {
// shiv for print
shivPrint(document);
}
The text was updated successfully, but these errors were encountered: