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.

Setup

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.

Step 1.

There has been a great deal of development in scripting languages. Currently, some popular scripting languages include Ruby, Python, PHP, JavaScript, Flex, and Groovy. JavaScript and PHP being two of the most notorious of course. These languages add functionality to sites and allow for the creation of applications and quality interfaces.

Step 2.

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:

These tags are typically placed in either the head or body section of the document.

Step 3.

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