including files

W

windandwaves

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
 
A

Angel

windandwaves said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top