Created
August 27, 2020 07:30
-
-
Save manojmohangit/21b6ba537c9b9b06d08e682872039a13 to your computer and use it in GitHub Desktop.
Loading Script in JavaScript
This file contains hidden or 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
(function () { | |
var customJS = document.createElement('script'); | |
customJS.type = 'text/javascript'; | |
customJS.async = true; | |
customJS.onload = function() {console.log("loaded")}; | |
customJS.src = 'custom.js'; | |
var scriptDom = document.getElementsByTagName('script')[0]; | |
scriptDom.parentNode.insertBefore(customJS, scriptDom); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment