Skip to content

Instantly share code, notes, and snippets.

@vunb
Last active December 16, 2015 11:39
Show Gist options
  • Save vunb/5428820 to your computer and use it in GitHub Desktop.
Save vunb/5428820 to your computer and use it in GitHub Desktop.
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