projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e12240
)
add onload.js to 2.3 branch, for mac addresses, RT#27190, RT#26013
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 23 Jan 2014 22:41:20 +0000
(14:41 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 23 Jan 2014 22:41:20 +0000
(14:41 -0800)
httemplate/elements/onload.js
[new file with mode: 0644]
patch
|
blob
diff --git a/httemplate/elements/onload.js
b/httemplate/elements/onload.js
new file mode 100644
(file)
index 0000000..
c7bbbb2
--- /dev/null
+++ b/
httemplate/elements/onload.js
@@ -0,0
+1,23
@@
+<%doc>
+Filter component to attach a window.onload handler.
+
+Usage:
+ <script>
+ <&| elements/onload.js &>
+ if ( the_stars_are_right ) {
+ run_this_function();
+ }
+ </&>
+ </script>
+
+</%doc>
+(function() {
+ var myonload = function() {
+<% $m->content %>
+ }
+ if ( window.addEventListener ) {
+ window.addEventListener('load', myonload);
+ } else if ( window.attachEvent ) {
+ window.attachEvent('onload', myonload);
+ }
+})();