When writing a script you will regularly use in a multiple Web pages site, instead of having to add the same script over and over again, you can simply save it as an external text file and then add in a pointer to every Web page you have. You should write this script without using the beginning and ending <script> and </script> tags and also without the HTML comment tags. Then you should change your file’s extension to .js. To point to the external script location, you need to include the "src" attribute. For example, saving an external script for a date display function as DateDisplay.js. Decide where you want the script to run and then insert the pointer into the HTML code where you wish the script to start running : <script type="yourtext/javascript" src="DateDisplay.js"></script>. This will call your external script and run it.
Advantages of External Scripts
When writing a script you will regularly use in a multiple Web pages site, instead of having to add the...
advantages external javascript
Also tagged with one or more of these keywords: advantages, external javascript
Software →
Paint Shop Pro →
PaintShop Pro X6 Ultimate advantages and disadvantagesStarted by Salwa, 27 Nov 2013 advantages, disadvantages and 2 more... |
|
|
||
Designer's Resources →
Photography →
Advantages and disadvantages of Super ZoomStarted by SmartWeb, 26 Apr 2013 advantages, disadvantages and 1 more... |
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users