ALS 3203 - Lesson 8
Scripts - Server side vs. Client-side

The following material is quoted directly from Goodman, D. 1996. JavaScript Bible Second Edition.IDG Books, Foster City, CA. xxvii + 607, CD-ROM included.

CGI Scripting

"One way to enhance the interaction between user and content is to have the page communicate with the Web server that houses the Web pages...When you cllick on the Submit or Search buttons, your browser sends your entries from the form to the server. On the server, a program knwon as CGI (Common Gateway Interface) script formats the data you've entered and sends it to a database or other program running on the server. The CGI script then sends the results to your browser, sometimes in the form of a new page or as information occupying other fields in the form.

Writing customized CGI scripts typically requires considerable programming skill. It definitely requires the Web page author to be in control of the server, including whatever back-end programs, such as databases, are needed to supply the results or to massage the information coming from the user. Even with the new, server based, web site design tools available, CGI scripting often is not a task that a content-oriented HTML author can do without handing it off to a more experienced programmer.

...CGI scripting...burdens the server with the job of processing queries. A busy server may be processing hundreds of CGI scripts at a time, while the client computers-the personal computers running the browsers-are sitting idle..."

Therein lies the use and need for client-side scripting with JavaScript. As I stated earlier, JavaScript scripts are processed on the client's computer and do not require server-side processing. This speeds up the process.However, there are limitations to client-side scripting.

"...Knowing how to match an authoring tool to a solution-building task is an important part of being a well-rounded Web page author. A Web page designer who ignores JavaScript is akin to a plumber who bruises his knuckles by using pliers instead of the wrench at the bottom of the toolbox. By the same token JavaScript won't fulfill every dream.

...look to JavaScript for the following kinds of solutions:

  • You want your web pages to respond or react directly to user interaction with form elements...and hypertext links--a class of application I call serverless CGI.
  • You want to distribute small colllections of database-like information and provide a friendly interface to that data.
  • You need to control multiple-frame navigation, plug-ins, or Java applets based on user choices in the HTML document.
  • You want data preprocessed on the client before submission to a server.
...The most common requests that JavaScript can't do for you are
  • Setting or retrieving the browser's preferences settings, main window appearance features, action buttons, and printing.
  • Launching an application on the client computer.
  • Reading or writing files or directories on the client computer.
  • Extracting the text content of HTML pages or their files from the server.
  • Writing files to the server.
  • Reading a server directory.
  • Capturing live data streams from the server.
  • Sending secret e-mails from Web site visitors to you."
Online Sites with free Scripts available for download:

Begin lesson
Today is: | ©P. M. Choate 2007
University of Florida Home Page