Writing for the World Wide Web | |
Home Course Information Assignments Schedule Class Notes Resources Student Pages |
Class Notes
Planning Site Navigation Organizing WWW Files Using Webpage Editors Upload / Download (FTP) Visual Design Appropriate Use of Technology Unix Commands Cascading Style Sheets JavaScript |
System Detection
Sometimes you want to create code that will act a certain way on one browser, but a different way on another browser. A good example of this is, with the "war" between Netscape and Microsoft, the different browsers create some of their own features that don't work on the opposing browser. There are JavaScript functions that allow your HTML document to recognize things like the browser type, browser version, screen size, and color-depth. Here are a couple lines of code that will display this information:
Here is a basic breakdown of what each part means:
The above lines of code will create the following display: Notice the version variable also displays other information, like the language in which the browser is written (which should be [en]) and the operating system information. |