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">
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.