projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
31f3ba7
)
better cross-browser onload handlers, fixes #24783
author
Mark Wells
<mark@freeside.biz>
Thu, 29 Aug 2013 19:01:01 +0000
(12:01 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 29 Aug 2013 19:01:08 +0000
(12:01 -0700)
httemplate/elements/onload.js
patch
|
blob
|
history
diff --git
a/httemplate/elements/onload.js
b/httemplate/elements/onload.js
index
bfa7eef
..
c7bbbb2
100644
(file)
--- 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);
+ }
})();