Page

2.5.1- Client-Side Alternatives

Created by Brendan Doss.
Last Updated by Jim Minatel.  

<< 2.5.0- The Alternatives To ASPChapter22.5.2- Server-Side Alternatives >>

Client-Side Alternatives

There are four major client-side technologies, which can be used to augment your web pages. The technologies are a mish-mash of cross- and single-browser solutions that have persisted through the years. We'll look at them in roughly chronological order (the exception being that, although Java existed before JavaScript, they were implemented at the same time in Netscape Navigator 2.0).

Client-Side Scripting Languages

Scripting has been present in Internet Explorer since version 3, and in Netscape Navigator/Communicator since version 2. Internet Explorer versions 3, 4 and 5 support both JScript (Microsoft's implementation of JavaScript) and VBScript, while Communicator 4.5 (and probably 5 as well) supports only JavaScript.

 

JavaScript support remains popular and strong in the latest versions of Internet Explorer (7) and in Mozilla and FireFox (the successors to Netscape). Mozilla and FireFox however never added VBScript support citing it as a security risk . (Keep in mind, the server side ASP you write using VBScript though is processed on the server, not in the browser, so lack of FireFox and Mozilla VBScript doesn't affect your ASP pages which work fine in these.)

 

Scripting languages provide dynamic capabilities; for example, we can write a routine that is executed each time the user clicks on a particular button on the page. The main disadvantage, as we mentioned earlier, is that client-side scripts are dependent on the browser's implementation of the language, so not all browsers support all scripting languages; and even when they do, there are often marked differences between each browsers implementation and usage of different features.

Java

Java is a cross-platform language for developing applications. When Java first hit the Web in the mid-1990s, it created a tremendous stir. The idea is to use Java code in the form of applets, which are essentially Java components that can be easily inserted into web pages with the aid of the <APPLET> tag.

 

Java enjoys better functionality than scripting languages, offering better capabilities in areas such as graphic functions and file-handling. Java is able to provide these powerful features without compromising security because Java applets run in what is known as a sandbox – which prevents malicious programs downloaded from the web from doing damage to your system. Java also boasts strong database support through JDBC (Java Database Connectivity).

 

Microsoft and Netscape browsers both have built-in Java support, and there are several standard <OBJECT> and non-standard <APPLET> tags which are used to add Java applets to a web page. These tags tell the browser to download a Java file from a server and execute it with the Java Virtual Machine built into the browser. Of course, this extra step in the web page building phase means that Java applets can take a little while to download, and they can take even longer to process once on the browser. So while smaller Java applets (that provide features such as drop-down menus and animations) are very popular on the Web, larger ones are still not as widespread as scripted pages.

 

Although the popularity of Java today isn't quite what some people expected, it makes an ideal teaching tool for people wishing to break out into more complex languages; and its versatility makes it well-suited for programming web applications.

ActiveX Controls

An ActiveX control is a self-contained program (or component), written in a language such as C++ or Visual Basic. When added to a web page, an ActiveX control provides a specific piece of client-side functionality, such as a bar chart and graph, timer, client authentication, or database access. ActiveX controls are added to HTML pages via the <OBJECT> tag, which is now part of the HTML standard. ActiveX controls can be executed by the browser when they are embedded in a web page.

 

There is a catch. ActiveX controls were developed by Microsoft, and despite being compatible with the HTML standard, they are not supported on any Netscape browser prior to version 5 (which, at time of writing, was still in beta) without an ActiveX plug-in. Without this, they will only function on Internet Explorer, although there are plug-ins available if you want ActiveX functionality with Netscape browsers. Consequently, they still can't really be considered a cross-platform way of making your pages dynamic.

ActiveX technology is also applicable to server-side functionality, in the form of ActiveX components.

 

As with VBScript, Mozilla and FireFox never added ActiveX support, again citing security concerns. 

 

Dynamic HTML

Dynamic HTML (or DHTML) is really nothing more than a buzzword – it was introduced by both Microsoft and Netscape with their version 4 browsers, to advertise additional scripting features such as the ability to animate pages and graphics without a page refresh, and to position text precisely by using
(x, y)-type coordinates. At the time, scripting was seeing a lower uptake than either company would have liked, so this move was intended to create a greater appeal to the masses, by dubbing it 'DHTML' and cashing in on HTML's familiarity and simplicity.

 

At the end of the day, the main innovation introduced in Dynamic HTML was the ability to manipulate any feature on a web page directly using client-side scripting. This was made available via the Document Object Model, but even together with the extra integration with style sheets, you're still creating your web page from client-side script and HTML. The main downside of DHTML was the fact that Microsoft and Netscape chose to implement these features in methods that were incompatible with one another. The advent of the version 5 browsers sees much tighter links with the standards, and hopefully a more cross-browser technology.

 

In 2005, a "new" technology called "Ajax " burst onto the web browser scene. Many people realized this this new Ajax looked a lot like old DHTML and in fact, Ajax owes a lot to DHTML and it is in wide use by experienced web developers now. While most Ajax pages make use of more advanced languages including XML, it remains rooted in what was once DHTML. Over the years, the differences in implementations have grown smaller with successive browser versions and the tools available for web programmers to write code specifically targeted to the individual browsers are much better.

<< 2.5.0- The Alternatives To ASPChapter22.5.2- Server-Side Alternatives >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |