I'm working on a Javascript file and I was wondering how do I include another .js file in it?
Or do I even have to, if I include 2 .js files in the same html page would functions in js1 be able to recognize functions defined in .js2?
Import a js file into a js file
Moderator: Thanas
- Chris OFarrell
- Durandal's Bitch
- Posts: 5724
- Joined: 2002-08-02 07:57pm
- Contact:
Re: Import a js file into a js file
I'm preaty sure you can't include one Javascript file inside another Javascript file. Sun designed JS for small menial stuff like input validation and what not, though its grown somewhat over the years. The idea being that hardcore programming stuff would all be done with the glorious JSP technology which would quickly replace all over client/server technology!Lord MJ wrote:I'm working on a Javascript file and I was wondering how do I include another .js file in it?
Or do I even have to, if I include 2 .js files in the same html page would functions in js1 be able to recognize functions defined in .js2?
*snickers*
But on topic, if you include the two scripts in the HTML page, they are in the same namespace as a matter of course.