A History of Browser Scripting

Early Web sites consisted of many of the same Web page elements we use today; forms, images, hyperlinks, and static text. They also consisted of small applications called applets that ran inside of the Web page and were written in a new programming language called Java. Netscape Communications had just added Java support to its flagship product, Netscape Navigator. However, Netscape was painfully aware that many Web site developers were not Java developers, so it needed to find a way to allow non-Java developers to interact with Java applets on Web pages. It did so with the introduction of LiveScript, a technology that was renamed JavaScript by the time it made it into Netscape Navigator 2.0. The year was 1995.

Web developers were quick to embrace JavaScript, but it was not used the way Netscape intended. It was mainly being used to provide programmatic access to page content such as forms, images, and text, not to script Java applets. In fact, the most common use for JavaScript at the time is still one of its most common uses today image swapping. Mouse rollovers were starting to appear all over the Internet.

At the same time, Microsoft released Internet Explorer 3.0, a major upgrade in its less-than-stellar Web browser. With the release of Internet Explorer 3.0, Microsoft unveiled its own flavor of JavaScript coined JScript. Microsoft also added its own scripting language (VBScript) and support for a new and emerging technology Cascading Style Sheets, or CSS. The inclusion of CSS support did not buy Microsoft much, however. Microsoft's JScript implementation did not include support for image swapping, and that made it useless in the eyes of the Web developers. Developers started writing scripts that checked browser versions, and if they detected Internet Explorer, they would simply not attempt to present any of the new dynamic content that scripting provided.

NOTE

At around this same time period, Web developers began writing scripts to check for Netscape browsers by seeing if the browser identified itself as "Mozilla," an identifier that Netscape Navigator used at the time. As browsers increased in functionality, they all began to identify themselves as "Mozilla Compatible" so that scripts would work successfully. Even today, you will see all browsers identified as Mozilla if you review server logs for your Web site.


Microsoft reacted with the release of Internet Explorer 3.02. Internet Explorer 3.02 added, among other things, support for image swapping. It also continued the divergence of scripting implementation among the major players in the Web browser world. Web developers were still not able to write a script that would easily run on any browser. Instead, they had to write a version of their scripts for each browser and use the appropriate one depending on which browser was being used to access their page. The Web developer community was aching for standards to be introduced to alleviate this problem. Sound familiar?

Netscape and Sun Microsystems, assisted by the European Computer Manufacturers Association (ECMA), standardized browser scripting with the release of ECMAScript in 1998. Ironically, Netscape was also in the process of releasing Netscape Navigator 4.0, a browser that would bring a completely proprietary document object model with it. Microsoft did the same with the release of Internet Explorer 4.0. These 4.0 series browsers introduced a robust new method of programming Web pages called Dynamic HTML (DHTML), a combination of HTML, CSS, and scripting. However, they also widened the gap in compatibility between the two browsers. ECMAScript was too late to stop the momentum.

For more information on DHTML, see "The Document Object Model," p. 480.


The majority of client-side scripting on the Internet today is used to script DHTML effects in Web pages. While Internet Explorer still supports VBScript as a scripting language, the vast majority of Web developers use JavaScript and not VBScript because it will work in all major browsers. For that reason, this chapter sticks to a discussion of JavaScript.

FrontPage provides tools such as Behaviors and Interactive Buttons that can generate JavaScript code for you. However, if you find that you want to add more robust scripts to your page or modify the scripts FrontPage generates or if the scripts that FrontPage generates don't perform the task you need knowing how to write JavaScript is a vital skill to have.

The purpose of this chapter is not to teach you how to be a JavaScript programmer. Instead, it is intended to give you a taste of what client-side scripting can be used for and the basics of how it is used. If you are interested in learning how to take maximum advantage of this powerful technology, you should pick up a book specifically with that purpose in mind.

For a comprehensive discussion on JavaScript and how to use it to make your Web pages more interactive, read Special Edition Using JavaScript.


O'Reilly and Associates, Inc. has a Web site with great information concerning the history and evolution of JavaScript. You can access it at http:javascript.frontpagelink.com.




Special Edition Using Microsoft Office FrontPage 2003
Special Edition Using Microsoft Office FrontPage 2003
ISBN: 0789729547
EAN: 2147483647
Year: 2003
Pages: 443

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net