[Javascript] Including additional javascript files

Alex Robinson latechjavascript at alex.cloudband.com
Mon Apr 4 12:01:04 CDT 2005


>>Some time ago I stumbled across a technique for including 
>>additional external javascript files that mirrored the way that 
>>additional CSS files can be included via the @import statement.
...
>A <script> tag in the header can reference an external file:
>
>         <script src="external.js" type="text/javascript"></script>

Sigh. Yes, looking at my post I can see that I was not explicit 
enough in my intent.

Yes, I'm fully aware that you can include javascript files the way 
that you've pointed out.

What I'm talking about is including further files from within the 
included file. That's why I made the reference to the @import 
statement in CSS where you can do something like:

A.css
@import "B.css"

B.css
@import "C.css"

(etc, as long as the statement comes before any rule blocks, that is)


Now, obviously you can't just put a <script src="foo"> in your 
javascript files, but I did, as I said, once stumble upon an example 
that showed a method for achieving that very end. That's what I'm 
after.



More information about the Javascript mailing list