Forum Moderators: open
Am I right in assuming the only code you put on the original pages would be:
<head>
<script type="text/javascript" src="test.js"></script>
</head>
I have 2 or three scripts I want to put in the .js page. Is it better to put them in sperate pages?
Also on the .js page do I start and end with the
<script type="text/javascript"> ... </script>
tags or simply put the code into it?
Many thanks
<head>
<script type="text/javascript" src="test.js"></script>
</head>
This is the correct syntax. Just place all your javascript code into the file with no start/end (<script>) tags.
You can put code in seperate files if you want, it doesn't really matter. It depends on what is easiest for maintence.
- JS