Introduction to VBScript
So you want to learn VBScript? You may already know HTML or XHTML and you want to move on to something more interactive, or you may have heard about VBScript and are curious about it, or one of many other reasons. Whatever your reason(s) may be, VBScript is a great language to learn!
This lesson focuses on:
- What you should already know
- What is VBScript?
- VBScript and Internet Explorer
- What can be done with VBScript?
What you should already know
Before studying VBScript, you should already have at least a basic understanding of HTML and/or XHTML. VBScript scripts are placed on webpages with HTML/XHTML tags and without knowing these tags, you will not know where and how to place VBScript scripts on a webpage. If you need to study HTML, you can do so at our HTML section. If you need to study XHTML, you can do so at our XHTML section.
What is VBScript?
VBScript is a scripting language used to provide dynamic and interactive content on webpages.
VBScript is short for Visual Basic Scripting Edition. VBScript is a lighter version of the Visual Basic programming language, and like Visual Basic, VBScript was developed by Microsoft.
VBScript and Internet Explorer
The most important thing to know about VBScript is that it is a proprietary language.
VBScript was designed by Microsoft to work in Internet Explorer and browsers based on Internet Explorer's engine such as Flashpeak's SlimBrowser.
VBScript code will NOT work in web browsers such as Mozilla Firefox and Netscape.
Due to the proprietary nature of VBScript, it is not a very popular scripting language on the world wide web. Instead, many people prefer using languages that are not proprietary and run on a variety of web browsers such as Javascript, and PHP.
What's the purpose of learning VBScript if it is a proprietary language and there are non-proprietary alternatives out there?
Here are some reasons:
-
Internet Explorer is the most popular web browser
Internet Explorer is the most popular web browser, so knowing how to write code specifically for it is a plus.
-
Browser specific code
There may come a time when you want to provide separate content on a webpage for users of a particular web browser.
-
Knowing another language
It's always good to know more. Even if you will use VBScript alot less than other scripting languages, you still have knowledge of another scripting language.
What can be done with VBScript?
There is alot you can do with VBScript:
-
Interact with the user
Interact with the user. For example, you can ask the user for their name and print a custom message with it on a webpage such as "Hello Roger!"
-
Form validation
Validate data entered by the user. For example, you can check to make sure that certain fields in a form were actually filled out, or that a piece of data contains the required amount of characters.
-
Perform calculations
You can use VBScript to perform a range of mathematical calculations ranging from simple arithmetic to complex formulas.
-
Act upon events
Specify code to run when certain events occur. For example, when the user clicks a button you can instruct VBScript to display a message in an alert box.
All this and much more can be done with VBScript!




