...

View Full Version : How to include a .js file in a .js file?



Garadon
04-13-2003, 10:52 AM
To include a .js file in a .html I write this
<script language="JavaScript1.2" src="FILENAME" type="text/javascript"></script>

But what do I write if I wanna include a .js file in a .js file?

HairyTeeth
04-13-2003, 11:05 AM
If you want to write an external file to a page(?)...
skeleton code:

//

var whichFile;

if(condition_A){
whileFile="<script...src='A.js></script>"
}else if(condition_B){
whichFile="<script...src='B.js'></script>"
}else{ //condition_C
whichFile="<script...src='C.js'></script>"
}
document.write(whichFile)

//


..or something like that. If you want to call another external js file from within an external js file...no idea.

Garadon
04-13-2003, 12:21 PM
well that is exactly what I wann do lol

..or something like that. If you want to call another external js file from within an external js file...no idea.

duniyadnd
04-13-2003, 08:21 PM
Wouldn't including all the js files in the html document take care of it, if you are using functions (which I hope you are doing in the first place).

Duniyadnd



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum