Skip to content

Instantly share code, notes, and snippets.

@batasrki
Created August 12, 2008 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batasrki/4985 to your computer and use it in GitHub Desktop.
Save batasrki/4985 to your computer and use it in GitHub Desktop.
JS - better load 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