Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Inclusion of one JavaScript file in another JavaScript file


Message #1 by kathy.egan@h... on Thu, 17 Jan 2002 14:20:24
Thanks!  Works great!
-----

> Actually - forget the comment I made about breaking up the word SCRIPT -
> this would only apply within an ASP
> 
> -----Original Message-----
> From: Alex Shiell, ITS, EC, SE 
> Sent: 17 January 2002 14:22
> To: javascript
> Subject: [javascript] RE: Inclusion of one JavaScript file in another
> Java Script file
> 
> 
> one way this is possible is to do this in x.js
> 
> document.write("<SCR"+"IPT language='javascript'
> SRC='library.js'></SCR"+"IPT>");
> 
> If your server is IIS you need to break up the word SCRIPT because the 
ASP
> parser seeks out script tags before processing the page, which can cause
> problems.
> 
> -----Original Message-----
> From: kathy.egan@h... [mailto:kathy.egan@h...]
> Sent: 17 January 2002 14:20
> To: javascript
> Subject: [javascript] Inclusion of one JavaScript file in another
> JavaScript file
> 
> 
> I've got a "library.js" file which contains all JavaScript functions 
common
> across all my pages.  It includes such functions as isDate, 
isPhoneNumber,
> isMilitaryTime, etc.  For web page X, I have a specific JavaScript file,
> x.js, that contains all the JavaScript for page X.  Instead of including
> both library.js and x.js in the head tag of page X, I want to include
> library.js within x.js using some type of "include" statement.  Is this
> possible?  If so, what is the syntax?

  Return to Index