Last active
March 16, 2023 23:31
-
-
Save lorashfuko/07bc5f30a3c8d38ff160 to your computer and use it in GitHub Desktop.
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> | |
var scripts = new Array('путь/до/файла.js'); | |
var css = new Array('путь/до/styles.css'); | |
function downloadJSAtOnload() { | |
var element; | |
for(var i = 0; i < scripts.length; i++){ | |
element = document.createElement("script"); | |
element.src = scripts[i]; | |
element.type = 'text/javascript'; | |
document.body.appendChild(element); | |
} | |
for(var i = 0; i < css.length; i++){ | |
element = document.createElement("link"); | |
element.href = css[i]; | |
element.type = 'text/css'; | |
element.rel = 'stylesheet'; | |
document.body.appendChild(element); | |
} | |
} | |
if (window.addEventListener) | |
window.addEventListener("load", downloadJSAtOnload, false); | |
else if (window.attachEvent) | |
window.attachEvent("onload", downloadJSAtOnload); | |
else window.onload = downloadJSAtOnload; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment