Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript add script in head programmatically

var my_awesome_script = document.createElement('script');

my_awesome_script.setAttribute('src','http://example.com/site.js');

document.head.appendChild(my_awesome_script);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #add #script #head #programmatically
ADD COMMENT
Topic
Name
1+3 =