• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Introduction to JavaScript > Handling Multiple Browsers

22.3. Handling Multiple Browsers

Unlike with CGI scripts, which run on the server and don't require any particular intelligence on the part of the browser, JavaScript code is completely dependent on browser support. If you put a JavaScript on your page, browsers that don't understand JavaScript won't know what to do with it. These browsers will interpret the code as straight text and the result will be rather unpleasant.

Not as unpleasant, however, as if your code isn't completely understood by a JavaScript-aware browser. Unfortunately JavaScript support is not an on-or-off option; Netscape has released several different versions of JavaScript with varying levels of support in each browser. To make matters worse, Microsoft's support for JavaScript has at times lagged behind Netscape's, sometimes outpaced it, and sometimes it's just been different. Fortunately, JavaScript provides ways to hide scripts from non-supporting browsers and to target the browsers that understand specific JavaScript elements.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint