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

Chapter 2. Start Me Up! > Hiding Scripts from Old Browsers

Hiding Scripts from Old Browsers

Very old browsers, which include Netscape 1.x, Microsoft Internet Explorer versions 3 and earlier, and the America Online browser before version 4, don't understand JavaScript. While well-behaved browsers are supposed to ignore everything between tags they don't understand, not all of them do. There's a technique (as shown in Script 2.2) that will fool these backward browsers into thinking that the contents of your script are actually HTML comments, which they will then ignore. A comment is text enclosed in -special tags; any text—notes, clarifications, explanations of code, whatever—inside these special tags gets ignored by the browser.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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