PDA

View Full Version : Making a JS external???


helpplease
08-17-2002, 06:17 PM
How do you make a JavaScript external?.... my code is becoming really long... i just want the HTML page to be neater.

Thanks.

TemperedSteel
08-17-2002, 06:24 PM
write the script in a new file, and save it a a .js file.
then in the HTML page,

<script src="filename.js">
</script>


thats it.

whammy
08-18-2002, 03:52 AM
Make sure that once you do that, in your external javascript file you don't have <script></script> tags, and the <!-- and // --> are also unnecessary in that case. :D