I stripped down this javascript to be as simple as possible, and it’s still not working in IE8.
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload !== 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
};
}
}
function callkits() {
alert('Kits: Bug testing');
}
//addLoadEvent(callkits);
//window.onload = callkits;
window.onload = function() {
callkits();
};
Neither of the two commented out methods, nor the active method, do anything in IE8. Javascript is enabled. (Calling alert directly, outside a function, does work.) I’m tearing my hair out here.
Edit:
Okay, it’s now even simpler:
alert('Before onload.')
window.onload = function() {
alert('Onload');
};
alert('After onload');
In Firefox, Opera, Safari, and Chrome, I get “Before onload”, “After onload”, then the page appears, then “Onload”. In IE8, that last step doesn’t happen. window.onload simply isn’t firing.
The standard onload event won’t work if another script is called using an HTML
defercommand.<script for="window" event="onload" defer="1">products.related();</script>Changing the above to use the standard
addLoadEvent()function made it work.