Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  21] [ 6]  / answers: 1 / hits: 30739  / 14 Years ago, thu, october 21, 2010, 12:00:00

Possible Duplicate:

How to include a JavaScript file in another JavaScript file?






I want to include a JavaScript file in a JavaScript file. include('filename.js'); is not working



What is the right code?


More From » javascript

 Answers
14
function includeJS(incFile)
{
document.write('<script type=text/javascript src='+ incFile+ '></script>');
}


Then include a second JavaScript file by calling:



includeJS('filename.js');

[#95219] Wednesday, October 20, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
keric

Total Points: 572
Total Questions: 93
Total Answers: 97

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
;