Skip to content

Instantly share code, notes, and snippets.

@QuestionDevelopment
Created August 23, 2013 20:02
Show Gist options
  • Save QuestionDevelopment/6323414 to your computer and use it in GitHub Desktop.
Save QuestionDevelopment/6323414 to your computer and use it in GitHub Desktop.
if(window.attachEvent) {
window.attachEvent('onload', yourFunctionName);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function() {
curronload();
yourFunctionName();
};
window.onload = newonload;
} else {
window.onload = yourFunctionName;
}
}
if(window.addEventListener) {
window.addEventListener('load',loadCart,false); //W3C
} else {
window.attachEvent('onload',loadCart); //IE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment