vunet said:
What's the possible disadvantage of including JavaScript files within
a JavaScript file?
Unreliability.
Why I needed it? For the sake of easy management, perhaps?
I do not need it. I do not know know why you did.
Any load speed disadvantage?
There is no load speed advantage in this to begin with: Provided that it
works, a script needs to be loaded, compiled and interpreted in order to
load another script.
Example below:
document.write('<script type="text/javascript" src="'+libraryName+'"><
\/script>');
You do not need to escape ETAGO's within external script resources as they
are not parsed by a markup parser (however, escaping them always can ease
maintenance).
You might want to escape `libraryName'. Anyway, you cannot be sure if and
where this `script' element is inserted if the statement is in an external
script resource.
With internal scripts, you simply put the script element where it belongs
(before the `script' element that includes code that uses features defined
in the former) and forget about the document.write() nonsense.
PointedEars