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 / December 2007



Tip: Looking for answers? Try searching our database.

Managing .js file dependencies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
icogs - 30 Dec 2007 13:06 GMT
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?
Thomas 'PointedEars' Lahn - 30 Dec 2007 13:48 GMT
> 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
Signature

var bugRiddenCrashPronePieceOfJunk = (
   navigator.userAgent.indexOf('MSIE 5') != -1
   && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

 
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.