can you including .js files in .js files?

can you including .js files in .js files?

Hello all -

can you include a .js file in a .js file?  for instance can make a file 

utils.js

that has various methods i am going to use over and over and then some other files..

myplugin1.js
myplugin2.js
...

where the methods internal to these plugins use the methods in utils .js.

--- as a related question.  is there a way to mimic class structure?  
for example say i have 

utils1.js and utils2.js

and they both have a method called "hello()"  id like to be able to be able to  include both .js files 
and then do something such as,


u1.hello()
u2.hello()

where u1.hello() calls hello in utils1.js and u2.hello() calls hello in utils2.js

    • Topic Participants

    • brook