[Javascript] javascript includes

Peter Brunone peter at brunone.com
Tue May 17 20:30:55 CDT 2005


Hi Rick,

	I'm not sure you'll find something like that, but why not meet
it halfway?  You could have an include file that contained all the
references to your JS files, and just include that one on the server.

For what it's worth...

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Rick den Haan

Hello List,

I couldn't find an answer on Google, so I thought I'd ask here.

Is it possible to include a .js file, FROM a .js file? I guess what I'm
looking for is the javascript equivalent to the PHP "include" command. I
know you can document.write() a <script src...> but is there no other
way?

The reason I'm asking is I have several completely different and
unrelated functions spread over several files, and instead of having six
or seven <script> tags in my <head>, and IMO it'd be a lot cleaner to
have one <script> tag including the one file that include the others.

Hope you can help

Rick.






More information about the Javascript mailing list