View Full Version : question:- Calling a javascript within a javascript?
mr_Al
04-05-2005, 12:04 PM
Hello,
i'm currently working on a page with a script that i want to be external, however it calls upon two javascript files. Now should i
a) put all the javascript files together in one big javascript??
b) Ask whether i can link the scripts together??
many thanks,
Al.
internal, embeded, external... it does not matter... it is the same thing, the javascript functions will act the same in all the cases...
Usually, external are used when the same script is needed for more pages. The code can be split in 2 merely when the code is quite long and you may need up-date or modify some variables from time to time...
brothercake
04-05-2005, 04:19 PM
internal, embeded, external... it does not matter... it is the same thing, the javascript functions will act the same in all the cases...
Usually, external are used when the same script is needed for more pages. The code can be split in 2 merely when the code is quite long and you may need up-date or modify some variables from time to time...
It does make a difference - inline scripting shows up in text browsers, unless you comment it out, but then it doesn't work in XHTML mode.
So, you shouldn't use inline scripting (or styles) at all - always put it in external files.
How many files to use, that's a subjective decision - you might want common functions in one file, and page or section-specific functions in another - depends what you're doing. Overall, try to streamline loading as much as possible - try not to load files which are not actually needed, unless they're already cached.
mr_Al
04-11-2005, 02:50 PM
Thanks guys :thumbsup:
will look into it more you've half confused me :o
thanks all the same.
Al.
*update*
tweaked what was said, fixed it now :thumbsup:
Thanks again peeps
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.