P1: 61
Irie WL040/Bidgoli-Vol III-Ch-62 June 23, 2003 16:43 Char Count= 0
770 WEBSITEDESIGNFigure 2: Block diagram of a Web site interaction
with client-side scripting.There are several client-side scripting languages, the
most common one being JavaScript, an object-oriented
language originally developed by Netscape. It is now a sta-
ndardized language, defined by the international industry
group European Computer Manufacturers Association,
and called ECMAScript (European Computer Manufac-
turers Association, 1999). Netscape continues to use the
term JavaScript, however, and Microsoft calls its imple-
mentation of ECMAScript for Windows browsers JScript.
The other major scripting language is Microsoft’s VB-
Script, short for Visual Basic Scripting Edition, which is
available only for Windows platforms (Champeon, 2001).
Regardless of the language, client-side scripts rely on a
standard programming interface, defined by the W3C and
called the Document Object Model (DOM), to dynamically
access and update the content, structure, and style of Web
documents (World Wide Web Consortium, 1998).
Cascading style sheets (CSS) is another W3C language
standard that allows styles (e.g., fonts, colors, and spac-
ing) to be associated with HTML documents. Any specific
HTML tag or group of HTML tags can be modified. It is
a language, separate from HTML, that expresses style in
common desktop publishing terminology. The combina-
tion of HTML, CSS, and DOM client-side scripts is often
referred to as dynamic HTML (Lie & Bos, 1999).
Client-side scripting is used primarily for dynamic user
interface elements, such as pull-down menus and ani-
mated buttons. The advantage of using client-side scripts
instead of server-side scripts for such elements is that
the execution is more immediate. Since the script, once
loaded from the server, is being executed by the browser
directly on the user’s computer, there are no delays asso-
ciated with the network or the server load. This makes the
user interface responsive and similar to standard platform
applications.
One of the disadvantages is that client-side scripting
languages are usually more limited in functionality than
server-side languages, so that complex processing is not
possible. Such limitations are by design, for security rea-
sons, and are not usually apparent for simple user inter-
face programming.
Users may also specifically choose not to allow client-
side scripts to execute on their computers, resulting in a
partial or complete reduction in functionality and usabil-
ity of a Web site. In general, it is recommended that a site
incorporate user interface scripting only sparingly, and
always with clear and functional alternatives.
Finally, because client-side programs, whether embed-
ded or stored separately, must necessarily be accessible
and viewable by the Web browser, they are also ulti-
mately viewable by the user. This may not be desirable forFigure 3: Block diagram of a Web site interaction with
server-side scripting.commercial Web applications, where the programming
logic can be considered intellectual property.
Since client-side scripts are embedded in HTML pages,
any tool that creates and edits HTML pages can also be
used to create the scripts. The only requirement is that
the client browser support the particular scripting lan-
guage. Most modern browsers support some variation of
Javascript/ECMAScript/JScript, whereas a smaller subset
support VBScript.Server Side
Figure 3 shows the basic architecture for a server-side dy-
namic site. Scripts are still stored in HTML documents on
the server’s file system, but are now executed on the server,
with only the program results and output being sent to the
client browser, along with the rest of the HTML page. To
the client browser, the HTTP response is a normal static
HTML Web page. Scripts are embedded in HTML docu-
ments using special HTML-like tags, or templates, whose
syntax depends on the particular server-side scripting lan-
guage (Weissinger, 2000).
There are several common server-side scripting lan-
guages, including PHP, Active Server Pages (ASP), and
Java Server Pages (JSP). The common gateway interface
(CGI) is also a server-side scripting mechanism, whereby
neither the Web content nor the programming logic is
stored in an HTML file. A separate program, stored in the
file system, dynamically generates the content. The Web
server forwards HTTP request information from the client
browser to the program using the CGI interface. The
program processes any relevant user input, generates an
HTML Web document and returns the dynamic content
to the browser via the Web server and the CGI interface.
This process is illustrated in Figure 4.
Server-side scripting is used primarily for complex and
time-consuming programming logic tasks, where imme-
diacy of response is not as critical as with user interface
elements. The advantage of using server-side scripts is the
freedom and computational power that is available on theFigure 4: Block diagram of a Web site interaction
with common gateway interface scripting.