Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > including files

Reply
Thread Tools

including files

 
 
windandwaves
Guest
Posts: n/a
 
      08-31-2006
Hi Folk

This seems like a really stupid question. Can you include a javascript
file in a javascript file?

Rather than doing this:

<script src="A"></script>
<script src="B"></script>

I want to do

<script src="A"></script>

and then have in script A:

include("B");

where include is a magic word that includes the file B.

Thanks in advance

Nicolaas

 
Reply With Quote
 
 
 
 
Angel
Guest
Posts: n/a
 
      08-31-2006

windandwaves wrote:
> Hi Folk
>
> This seems like a really stupid question. Can you include a javascript
> file in a javascript file?
>
> Rather than doing this:
>
> <script src="A"></script>
> <script src="B"></script>
>
> I want to do
>
> <script src="A"></script>
>
> and then have in script A:
>
> include("B");
>
> where include is a magic word that includes the file B.
>
> Thanks in advance
>
> Nicolaas



Add the following statement in the first javascript file

document.write('<script language="javascript" src="B.js"></script>')


HTH,
Angel

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
including .specification files (or other "dot" files) in RakePackage on Linux/Mac OS X Nathan Beyer Ruby 0 11-15-2009 09:34 PM
How to avoid including C files in other C files in an old code base Raman C Programming 5 06-07-2008 08:43 PM
"Including" multiple files? farmer ASP .Net 5 08-02-2005 04:10 AM
Re: Protect an entire directory (including non-ASP.NET files) Xavier MT ASP .Net 1 08-19-2003 05:57 PM
Re: Protect an entire directory (including non-ASP.NET files) MS News \(MS ILM\) ASP .Net 1 08-19-2003 03:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57