VBScript Tutorials - Herong's Tutorial Examples - v6.02, by Herong Yang
Static, Client-Side and Server-Side Scripting Pages
This section describes differences of static content, client-side scripting code, and server-side scripting code.
If you are using IIS as the Web server and IE as the Web browser, you can 3 types of contents into a Web page:
Here, I have 3 Web pages to display a time in 3 different ways: static content, client-side scripting code, and server-side scripting.
1. time_static.html: A static page displaying a static time.
<html><body>The current static time is: 11/26/1999 10:19:46 PM </body></html>
If you open this page with any Web browser, you should see the static time, which will not change when you open the page again some time later.
The current static time is: 11/26/1999 10:19:46 PM
2. time_client.html: A client scripting page displaying the time dynamically out of the client system.
<html><body>The current client time is: <script language="vbscript"> document.write(Date & " " & Time) </script> </body></html>
If you open this page with any Web browser that can execute VBScript statements, like MS Internet Explorer (IE) 5, you will see the current time of the client system. The displayed time will change when you open the page again some time later.
The current client time is: 11/26/1999 10:26:08 PM
3. time_server.asp: A server scripting (ASP) page displaying the time dynamically out of the server system. File name extension ".asp" is needed to inform Web server to be ready to execute the embedded script statements.
<%@ language="vbscript"%> <html><body>The current server time is: <% response.write(Date & " " & Time) %> </body></html>
Since an ASP page needs a Web server to execute the script statements, you need to copy this page to the document directory of the IIS server:
copy time_server.asp \inetpub\wwwroot
If you now open this page with IE 5 at http://localhost/time_server.asp, you will see the current of the server system. The displayed time will change when you open the page again some time later.
The current server time is: 11/26/1999 10:43:32 PM
Notice that I am using the same scripting language, VBScript, for both time_client.html and time_server.asp.
Table of Contents
Introduction of VBScript - Visual Basic Scripting Edition
Variant Data Type, Subtypes, and Literals
Numeric Comparison Operations and Logical Operations
String Operations - Concatenation and Comparison
Variable Declaration and Assignment Statement
Expression and Order of Operation Precedence
Statement Syntax and Statement Types
Array Data Type and Related Statements
Array References and Array Assignment Statements
Conditional Statements - "If ... Then" and "Select Case"
Loop Statements - "For", "While", and "Do"
"Function" and "Sub" Procedures
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
IE Web Browser Supporting VBScript
►IIS ASP Server Supporting VBScript
What is ASP (Active Server Pages)?
►Static, Client-Side and Server-Side Scripting Pages
Setting Up IIS to Run ASP Pages - asp.dll
ASP Objects: Request, Response, Session and Application
ASP Object Example - Passing Values between Pages
Interacting with External Applications - ActiveX Data Object (ADO)