You can very easily integrate java script into your html pages. Most of the browsers on the Internet support java script.
One of the most important things, which is required on the Internet, the Navigation can be done with the help JavaScript. These scripts are called the navigational scripts and they are used for navigating from one page to another. These scripts help your visitors to move around your website with the help of menu lists and buttons.
Let us study one example, which helps us to move behind on the previous and the next page of your browser.
You can also use the above script in an external file. But there are certain important things you need to keep in mind about external java script usage are as follows.
1. External JavaScript files can be used on many pages but you do not need to write one for each page so basically you are writing once and using it on multiple pages and hence has lots of code reuse.
2. You can have both types of scripts in the external file head scripts and body scripts.
3.Script file should not contain the script tag.
4.You do not want your code to be visible or you want to use it on multiple pages then you can also create an external java script file.
Procedure To Create An External Java Script File.
Click on notepad
Type the JavaScript code and save the file with extension js
For calling the script you can use the code below.
<script type="text/javascript" src="xxx.js">
</script>
Conclusion
The reuse of the code is one of the most important things of java script. Along with the navigation part the code reuse becomes a very important feature of JavaScript.