View Full Version : Script simplification

07-25-2002, 09:57 PM
Please help me to simplify this script:

<script language="JavaScript" src="file1.js"></script>
<script language="JavaScript" src="file2.js"></script>
<script language="JavaScript" src="file3.js"></script>

into something like this:

<script language="JavaScript" src="file1.js", src="file2.js", src="file3.js", ></script>

thank you

07-25-2002, 10:27 PM
You can't expect to rewrite the rendering mechanism of browsers - you'll have to include an external javascript file as usual, because this way is sort of standardized.

You can also put all external code together into one file and only include this if that suits your purpose. For me, that would be slightly confusing.

Alternatively, you can write the external files dynamically with javascript:

for (var i = 1; i < 4; i++) {
document.write('<script language="JavaScript" src="file1.js"><\/script>');