Skip to content

Instantly share code, notes, and snippets.

@jesgundy
Created September 11, 2012 13:23
Show Gist options
  • Save jesgundy/3698428 to your computer and use it in GitHub Desktop.
Save jesgundy/3698428 to your computer and use it in GitHub Desktop.
Add load event function
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment