JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2058
Number of posts: 5158

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Including .js file into another .js file? Posted by MoeeN AhmaD on 20 Mar 2006 at 3:44 AM
Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
Report
Re: Including .js file into another .js file? Posted by zibadian on 20 Mar 2006 at 4:19 AM
: Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
:
All external files, which are included in the same html file using the <script> tag, can make use of one and another. Thus:
<script src="one.js"></script>
<script src="two.js"></script>

functions in two.js can call functions defined in one.js, and vice versa.
Report
Re: Including .js file into another .js file? Posted by MoeeN AhmaD on 20 Mar 2006 at 4:37 AM
: : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
: :
: All external files, which are included in the same html file using the <script> tag, can make use of one and another. Thus:
:
: <script src="one.js"></script>
: <script src="two.js"></script>
: 

: functions in two.js can call functions defined in one.js, and vice versa.
:

ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!

Report
Re: Including .js file into another .js file? Posted by zibadian on 20 Mar 2006 at 5:10 AM
: : : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
: : :
: : All external files, which are included in the same html file using the <script> tag, can make use of one and another. Thus:
: :
: : <script src="one.js"></script>
: : <script src="two.js"></script>
: : 

: : functions in two.js can call functions defined in one.js, and vice versa.
: :
:
: ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!
:
:
As far as I know, that's impossible. But perhaps you can find more info on www.w3schools.com.
Report
Re: Including .js file into another .js file? Posted by aaronjones3593 on 23 Mar 2006 at 5:30 PM
: : : : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
: : : :
: : : All external files, which are included in the same html file using the <script> tag, can make use of one and another. Thus:
: : :
: : : <script src="one.js"></script>
: : : <script src="two.js"></script>
: : : 

: : : functions in two.js can call functions defined in one.js, and vice versa.
: : :
: :
: : ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!
: :
: :
: As far as I know, that's impossible. But perhaps you can find more info on www.w3schools.com.
:
He's right; It's not possile for JavaScript to include another JS file like ASP can. You will have to have a search and replace for your pages in NotePad or something similar...

Search for: <script src="one.js"></script>
Replace with: <script src="one.js"></script><script src="two.js"></script>

Sorry,


-( Aaron )-

"Alcohol aint the answer, but atleast you forget the question"




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.