Posted By

iroybot on 07/11/10


Tagged

javascript js addLoadEvent


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

iroybot
nerdfiles


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  

You need to login to post a comment.