Hi,

I've found this script searching this forum, just wondering if anyone's used it and knows if it's safe to use with all browsers? or if there's a better solution to the problem of having multiple onloads.

Code:
<!--
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent();
addLoadEvent(function() {
  /* more code to run on page load */ 
});
//-->