Created
August 12, 2008 01:50
-
-
Save batasrki/4985 to your computer and use it in GitHub Desktop.
JS - better load function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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