Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / August 2006



Tip: Looking for answers? Try searching our database.

including files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
windandwaves - 31 Aug 2006 07:43 GMT
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
Angel - 31 Aug 2006 08:31 GMT
> Hi Folk
>
[quoted text clipped - 19 lines]
>
> Nicolaas

Add the following statement in the first javascript file

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

HTH,
Angel
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.