From e2c0189bf2deb08a5423226a5adc4d245e64bf4f Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 23 Jan 2014 14:41:20 -0800 Subject: [PATCH] add onload.js to 2.3 branch, for mac addresses, RT#27190, RT#26013 --- httemplate/elements/onload.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 httemplate/elements/onload.js diff --git a/httemplate/elements/onload.js b/httemplate/elements/onload.js new file mode 100644 index 000000000..c7bbbb283 --- /dev/null +++ b/httemplate/elements/onload.js @@ -0,0 +1,23 @@ +<%doc> +Filter component to attach a window.onload handler. + +Usage: + + + +(function() { + var myonload = function() { +<% $m->content %> + } + if ( window.addEventListener ) { + window.addEventListener('load', myonload); + } else if ( window.attachEvent ) { + window.attachEvent('onload', myonload); + } +})(); -- 2.11.0