From: Mark Wells Date: Thu, 29 Aug 2013 19:02:16 +0000 (-0700) Subject: better cross-browser onload handlers, fixes #24783 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=0dbb8441d07bea4d193966370f2349ba3346442d;hp=3be960f69d36d11f6f080e9e28ed167996df4f26;p=freeside.git better cross-browser onload handlers, fixes #24783 --- diff --git a/httemplate/elements/onload.js b/httemplate/elements/onload.js index bfa7eef94..c7bbbb283 100644 --- a/httemplate/elements/onload.js +++ b/httemplate/elements/onload.js @@ -12,11 +12,12 @@ Usage: (function() { - var tmp = window.onload; - window.onload = function() { - if (typeof(tmp)== 'function') { - tmp(); - } + var myonload = function() { <% $m->content %> - }; + } + if ( window.addEventListener ) { + window.addEventListener('load', myonload); + } else if ( window.attachEvent ) { + window.attachEvent('onload', myonload); + } })();