|
|
Getting startedVBScript, also known as Visual Basic Scripting Edition, requires absolutely nothing which is not freely available on the Internet. In fact, most computers already have most of what is needed. The tools necessary for writing VBScript are as follows:
The <SCRIPT> TagScripting languages, like JavaScript and VBScript, are designed as an extension to HTML. The Web browser receives scripts along with the rest of the Web document. It is the browser's responsibility to parse and process the scripts. HTML was extended to include a tag that is used to incorporate scripts into HTML - the <SCRIPT> tag. The scripts are added into the Web pages within a pair of <SCRIPT> tags. The <SCRIPT> tag signifies the start of the script section, while </SCRIPT> marks the end. An example of this is a simple program for page initialization. After the page is loaded, a message "Welcome to VB Script" appears. As in VISUAL BASIC and regular BASIC, the comments are separated from a code by apostrophe (') mark. <HTML> <HEAD> <SCRIPT LANGUAGE="VBScript"> 'Start of the script section Sub Init() 'Start of VBScript procedure Msgbox "Welcome to VB script" 'VBScript code End Sub 'End of VBScript procedure </SCRIPT> 'End of Script section </HEAD> <BODY onload="Init()"> 'Begins the document body </BODY> 'Ends the document body </HTML> The beginning <SCRIPT> tag includes a LANGUAGE argument that indicates the scripting language that will be used. The LANGUAGE argument is required because there is more than one scripting language. Without the LANGUAGE argument, a Web browser would not know if the text between the tags was JavaScript, VBScript or another scripting language. You can use SCRIPT blocks anywhere in an HTML page. As for me, I prefer put all general-purpose scripting code in the HEAD section in order to keep all the code together.This provides easy reference and maintenance of code and ensures that all code is read and decoded before it's needed by any calls from within the BODY section. Go To Page: 1 2
The copyright of the article Adding VBScript to Web Pages in VB Script is owned by . Permission to republish Adding VBScript to Web Pages in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|