Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to insert Script tag dynamically into header
thnq..
Posted
Updated 2-Nov-12 20:09pm
v2
Comments
VenuKalyan 3-Nov-12 5:44am    
thnq vry much..

1 solution

add this to your code.
C#
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://localhost/WebTut/Script/jsFile.js';
headID.appendChild(newScript);
 
Share this answer
 
Comments
VenuKalyan 18-Dec-12 5:52am    
its added but the scripts are not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900