WebReference.com - Chapter 6 of Designing with JavaScript, from O'Reilly. | WebReference

WebReference.com - Chapter 6 of Designing with JavaScript, from O'Reilly.

home / programming / javascript / designing / chap6

Designing with JavaScript, 2nd Edition

[The excerpts printed here are from Chapter 6 of the O'Reilly & Associates title Designing with JavaScript, 2nd Edition.]

 »  Detecting different browsers using the navigator object  
 »  Tailoring content to specific browsers  
 »  Checking for plug-ins  

A long time ago, life was simple: there was standard HTML and NCSA Mosaic. Then came Netscape Navigator, with its HTML "extensions," and suddenly sites started labeling themselves "Enhanced for Netscape," meaning, of course, "this site looks lousy in Mosaic." By the time Microsoft came along with Internet Explorer, Mosaic was effectively dead, and Netscape and Microsoft were locked in a war to extend HTML in ways that would make one of their products the dominant browser. Fortunately, they both handled JavaScript, albeit to different extents, so it became the job of JavaScript to differentiate between the two.

As of this writing, that war is just about over. Microsoft Internet Explorer (IE) is by far the dominant browser, though Netscape has finally released an updated browser, Netscape 6, years after being bought by America Online. Of course, many people still use Netscape Navigator, and many others use older versions of Internet Explorer, so the basic problem remains: how do you find out which browser a given user is using and tailor your site accordingly?

This chapter is all about making your site as friendly as possible to each browser, as well as to different versions of those browsers.

Excerpt Contents

home / programming / javascript / designing / chap6

Created: December 17, 2001
Revised: December 27, 2001

URL: http://webreference.com/programming/javascript/designing/chap6/