Adding VBScript to your page.
Adding scripts to your Web pages is easy. All you have to do is place the begin tag <SCRIPT> where the script starts and the end tag </SCRIPT> where it ends. The <SCRIPT> tag has one attribute called LANGUAGE, which identifies the scripting language you're using. Since you're creating scripts in VBScript, use the value LANGUAGE="VBScript" to tell this to your browser.
Here's an example of how to add a script to your page:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<!--
<SCRIPT LANGUAGE="VBScript">
Insert your script here!
-->
</SCRIPT>
</BODY>
</HTML>
Although the most popular browsers available today support scripts, browsers that don't support scripts display your script's code with the contents of your Web page. To avoid this problem, follow the begin script tag with a begin comment tag, and precede the end script tag with an end comment tag as in the above example.
Throughout this article, I’ll be using several examples, and I’ll be giving only the VBScript part, so if you want to try the scripts, just copy the above HTML codes and inserts your scripts between the <SCRIPT> tags. Then paste it in notepad or any text editor of your choice and save it as .html and run it in your browser.
Variables
Giving the variable a name, which you can later refer to the variable by name in your code, easily creates variables in VBScripts both explicitly and implicitly.
When you declare an explicit variable, you tell VBScript with the keyword Dim that you're creating a variable, and then follow the Dim keyword with the variable name. If you wanted to explicitly declare a variable called eValue, you could use the following:
<SCRIPT LANGUAGE="VBScript">
<!--
Dim eValue
eValue = eValue + 1
-->
</SCRIPT>
When you implicitly declare a variable, you use the variable without first declaring it, so you don't need to use the Dim keyword. VBScript creates the variable for you as necessary. If you wanted to use a variable called iValue implicitly, you could use the following:
<SCRIPT LANGUAGE="VBScript">
<!--
iValue = 150
-->
</SCRIPT>