Quite simply I can't seem to get this JS file to delay, I have the code working in another website where the file isn't in a folder, but when its in a folder I get no love!
Below is what I'm trying to do:
<script type="text/javascript">
// Add a script element as a child of the body
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "js/example.js";
document.body.appendChild(element);
}
// Check for browser support of event handling capability
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
Its had me for a day or so on and off so far, appreciate anyone enlightening me on what I'm doing wrong