homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

JavaScript Tags
multiple external scripts called from 1 tag?

 7:20 am on Feb 17, 2002 (gmt 0)

Can multiple external JavaScripts, including one with a different lang type, be called from inside one tag? In other words, can this:

<script type="text/javascript" language="JavaScript"
<script language="JavaScript" type="text/javascript" src="/scripts/script2.js"></script>
<script language="JavaScript" src="/scripts/script3.js"></script>
<script language="JavaScript" type="text/javascript" src="/scripts/script4"></script>
<script language="JavaScript1.2" type="text/javascript"

... be written something like:

<script type="text/javascript"
src="/scripts/script1.js" ;
src="/scripts/script2.js" ;
src="/scripts/script3.js" ;
src="/scripts/script4.js" ;

and if so, can it be even more concise?


Black Knight

 12:59 pm on Feb 17, 2002 (gmt 0)

No. One source (SRC) attribute per tag only.

To combine javascripts, put all of the javascript into a single .js file.

Alternately you can 'fudge' it by creating a javascript to write in all the other javascript tags.

Ammon Johns


 8:54 pm on Feb 17, 2002 (gmt 0)


How would I seperate the scripts if they were all on the one external file?

Black Knight

 10:58 pm on Feb 17, 2002 (gmt 0)

If they use the same language and version, there is no need to separate them at all, just define all the functions for all the scripts in one single big bite.

In other words, paste the contents of each .JS file, one after the other, into a single .JS file.

To fudge it just use one external JavaScript that uses the write() method to write-in all the other JavaScript calls


document.write('<SCRIPT LANGUAGE="JavaScript" SRC="scripts/script1.js"> </SCRIPT>');
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="scripts/script2.js"> </SCRIPT>');
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="scripts/script3.js"> </SCRIPT>');
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="scripts/script4.js"> </SCRIPT>');


 1:59 am on Feb 18, 2002 (gmt 0)

That's working just fine Black_Knight
Thanks again

Black Knight

 8:16 am on Mar 5, 2002 (gmt 0)

Glad to have been of help.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved