dcsimg

How can I easily reuse the same JavaScript code in multiple HTML files?

John Zukowski

You can place the JavaScript code in a .js file and reference the file from the src attribute of hte SCRIPT tag:


<script src="http://www.foo.bar/scriptfile.js">
</script>