Managing .js file dependencies

I

icogs

I am fairly new to Javascript, coming from a Java & C/C++ background
so the possibility of a fundamental misunderstanding on my part cannot
be ruled out :-(

Lets say a friend sends me some really useful javascript code in
useful.js. I want to call some of this code in my own code in
myproject.js, making source in this file depenent on useful.js. Do I
need to have <script ..> tags for both files or can I add something to
myproject.js which will manage this dependency for me?
 
T

Thomas 'PointedEars' Lahn

icogs said:
Lets say a friend sends me some really useful javascript code in
useful.js. I want to call some of this code in my own code in
myproject.js, making source in this file depenent on useful.js. Do I
need to have <script ..> tags for both files

You better have two `script' _elements_ for both _resources_.
or can I add something to myproject.js which will manage this
dependency for me?

There are dirty DOM hacks but as dirty hacks go they are unreliable.


PointedEars
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top