How to Add Scripts to an HTML Page
In this tutorial, you will learn how scripts are applied to HTML documents, what sorts of scripts are out there, and how to handle browsers that do not support scripts.
This tutorial was written using Visual Studio 2010. Visual Studio is available for free in its express edition to the public. Just go to Microsoft.com/Visual Studio. Go ahead and open up Visual Studio or your favorite text editor. Save this project with the name of your choice.
You can simply place a script tag with the type and file of your script. Or you could simply put the script within the script tags. The code for embedding or referencing scripts is as followed:
<script type="text/scriptname" src="">
These tags are typically placed in either the head or body section of the document.
In the case where a browser does not support a script, or any script at all, you can place a message much like the following between two noscript tags as presented below:
These tags are placed in the actual body and not the head. The inner text of the no script tags will be displayed if a script fails to load.
A Few Last Words…
Scripts are a great way to enhance your website, and they can be quite useful at times. Join us next time for additional HTML tutorials. See you then!
Download Source Files