Created
March 3, 2014 14:21
-
-
Save anytizer/9325866 to your computer and use it in GitHub Desktop.
attach js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
/** | |
* Add a script element as a child of the body | |
*/ | |
function attachJS() | |
{ | |
var element = document.createElement("script"); | |
element.src = "js/attached.js" | |
document.body.appendChild(element); | |
} | |
// Browser capability | |
if(window.addEventListener) | |
window.addEventListener("load", attachJS, false); | |
else if(window.attachEvent) | |
window.attachEvent("onload", attachJS); | |
else window.onload = attachJS; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment