We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

damarev on 11/26/06


Tagged


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

rnrleachryan
vali29


addLoadEvent


Published in: JavaScript 


  1. function addLoadEvent(func) {
  2. var oldonload = window.onload;
  3. if (typeof window.onload != 'function') {
  4. window.onload = func;
  5. }
  6. else {
  7. window.onload = function() {
  8. oldonload();
  9. func();
  10. }
  11. }
  12. }

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: eunjoo1984 on December 12, 2006

sorry missed up

Posted By: eunjoo1984 on December 12, 2006
Posted By: eunjoo1984 on December 12, 2006
Posted By: eunjoo1984 on December 12, 2006

You need to login to post a comment.