Advertisement
Guest User

Untitled

a guest
Jun 6th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function insertScript(scriptURI) {
  2.    const scriptElement = document.createElement('script')
  3.    scriptElement.type = 'text/javascript'
  4.    scriptElement.onload = () => {
  5.       console.log("JS file loaded ! :D")
  6.    }
  7.    scriptElement.src = scriptURI
  8.    document.head.appendChild(scriptElement)
  9. }
  10.  
  11. // Call
  12. insertScript("URL Script")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement