summaryrefslogtreecommitdiff
path: root/httemplate/elements/onload.js
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-09-03 22:52:26 -0700
committerIvan Kohler <ivan@freeside.biz>2013-09-03 22:52:26 -0700
commit36ad5e538cb56de33c779e34baf9abdf63c4312e (patch)
treede42d922496c881b69643656f055b68e64e96d72 /httemplate/elements/onload.js
parent04c1a98c9bcf2b6f0da8f18b627eec703dbafd49 (diff)
parentaae697565c071b2880d0106b00a4a01d0ddab7bf (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/onload.js')
-rw-r--r--httemplate/elements/onload.js13
1 files changed, 7 insertions, 6 deletions
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:
</%doc>
(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);
+ }
})();