By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,808 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

including files

P: n/a
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

Aug 31 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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

Aug 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.