External JS Files
Question: Can I include JavaScript code from external JS files, rather than embedding all my scripts within HTML pages?
Answer:
Yes. To do so, create a new file with the extension
To embed <script type="text/javascript" src="myscript.js"> </script>In practice, you may find it convenient to create .js
files containing JavaScript functions that you reuse
on multpile webpages. Usually (but not always)
the <script> tags specifying the included
JavaScript files are placed in the
<head> section of the page.
Historical note: See also: |
Copyright © 1999-2011, JavaScripter.net.