Monday, May 19, 2008

Attach an OnLoad event in FireFox and IE using JavaScript

IE uses the function attachEvent while FireFox uses addEventListener. IE calls the event onload, while Firefox calls it load. Your function can be called anything.


if(document.all)
window.attachEvent('onload',Yourfunction);
else
window.addEventListener("load",Yourfunction,false);

No comments:

Labels

Blog Archive

Contributors