Software Identification   «Prev  Next»
Lesson 4Scripting Languages
ObjectiveDescribe the Functions of Common Types of Scripting Languages

Scripting Languages Common Type Functions

The next type of language you will learn about is scripting language. A scripting language is based on a host, or primary language, but it uses a simplified command method with reduced functionality to accomplish basic operations such as form handling and text processing (or anything else). For example, VBScript is the scripting language based on VBasic, the host, or primary language.

A Script Example

Let's understand this relationship between a script and its host. Imagine writing two short programs. The first one is designed to scan a document for the word "America." When found, the program is to simply bold and italicize it. We'll call that program "Find-Am." The second program scans the document for the word "Columbus" and also bolds and italicizes. We'll call it "Find-Col." If each program were written in, say, Visual Basic (VB), then Visual Basic would be the host language. We can now write a script that will find, bold, and italicize the words "America" and "Columbus" just by typing two commands: Find-Am, and on the next line, Find-Col. While the script command triggered the programs, the actual changes were executed by the program's host, which was Visual Basic.

Easier, but slower


The nice thing about scripting languages is they're easy to learn, because you only need to concentrate on the names of the functions, not how they are developed. So scripting languages are really simplified programming languages that use pre-named modules, each activated sequentially via a script. The drawback is a lack of flexibility when attempting to perform unique operations. Finally, their execution tends to be much slower than true 'code' in performing similar operations.

Scripts: what and where?

Since scripts are just a series of name modules, their use has become quite popular in Web pages. Small scripts, placed within a Web page can activate a browser's host language (usually Java or VB) to perform fairly complex tasks like graphic animation or numeric calculation. Let us look at a few of these operations.

Learning Web Design

What can client-side scripts do?

Client-side scripts are embedded in HTML pages. Because the processing occurs at the user's computer, scripts speed the interaction by saving processing time at the Web server, and saving traffic time going to and from the server. Client-side scripts are used to perform the following functions:
  1. Provide drop-down menus to enhance site navigation
  2. Open a browser window
  3. Generate events such as a MouseOver, that is, a change in graphics or text when a user's mouse touches an element on the screen
  4. Check for a plug-in or a particular browser version and display the appropriate page
  5. Validate user input (such as, "Entries in the zip code field must have 5 numbers")
  6. Display error or informational pop-ups

Because the code is relying on the browser, developers should be aware of the following limitations:
  1. There may be limited browser support for some functions.
  2. Visitors can disable JavaScript and/or JScript in their browser's preferences.

Browser issues


As you become more acquainted with the Web environment, you'll hear more and more about particular feature incompatibilities between Netscape and IE (Internet Explorer). One primary area of contention relates to the execution of scripts. For example, not all scripts work on both browsers. As you will read below, ActiveX scripts will not work in Netscape, while they'll work fine in Explorer.
The opposite is true for certain Java scripts. The reason is that each manufacturer (Netscape vs. Microsoft) has provided different host language capabilities in their browsers.

Applets, Java Applets, and ActiveX


Applets, Java Applets, and ActiveX are programs run on the client side. An applet is a small application such as a utility.
Java applets are small programs written in the Java language. ActiveX, from Microsoft, adds functionality by enabling a program to call forth ready-made components to perform common tasks. ActiveX is typically used to add user interface functions and enhance the processing of multimedia commands.

What can server-side scripts do?

Server-side scripts are used to extend the functionality of a Web server. For example, CGI (Common Gateway Interface) scripts can be used to add interactivity to Web pages. It's often referred to as a "transport" language because its job is to transport data from the user's Web page into the server for execution by a program (like VB). CGI does not actually perform calculations.
Typical applications for CGI scripts include:
  1. Interactive forms for handling the submission of data from a Web client, such as a guest book or order form
  2. Searchable indexes of documents on the Web server
  3. Page counters to track how many visitors a Web page receives
CGI scripts can be written with a procedural, object-oriented, or scripting language such as Perl. Other functions that can be performed with a server-side scripts include:
  1. Collecting form data
  2. Generating dynamic page content
  3. Sending and receiving cookies
  4. Accessing a database
  5. Redirecting a visitor to another URL
  6. Managing shopping carts
  7. Validating credit card information used for purchasing
In the next lesson, you will begin learning about the wide variety of software applications that are used in creating and running Internet sites.

Web Scripting Languages

Click the link below to check what you have learned about scripts.
Web Scripting Languages

Web Application Language Review - Quiz

Click the Quiz link below to review your learning of languages used for Web functionality.
Web Application Language Review - Quiz