Skip to navigation
How to load a javascript when a page get loaded?
07.12.13
instead of adding a onload to the body tag you can add this to your js file: function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } }
Reply
Anonymous
How to load a javascript when a page get loaded?
instead of adding a onload to the body tag you can add this to your js file: function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } }
07.12.13
Reply
Anonymous
Information Epoch 1732449538
Effectiveness beats efficiency.
Home
Notebook
Contact us