JavaScripts can be placed in external files. The external files usually contain code that will be used by a number of different web pages.
An external JavaScript file would.js as its file extension. To use an external javascript, you have to point to the ‘ .js’ file in the ‘src’ attribute of the tag <script> :
Example of an external JavaScript
<!DOCTYPE html>
<html>
<body>
<script src="NewScript.js"></script>
</body>
</html>
You can place the javascript anywhere in the <head> or <body>. The script will just behave as it was exactly located where the <script> tag was put in the document.
External JavaScripts
JavaScripts can be placed in external files. The external files usually contain code that will be used...
external javascripts
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users