Bottom of This Page |
Browser Report This script sends the values of the navigator object's properties to a browser window (for security-reasons this only works offline).
|
||
Browser Name Browser Code Name Browser Version Browser System Info Browser JavaScript Support Info |
||
Sample script to costomizing your Web site for individual browsers showing Browser Tricks For Cross-Browser Compatibility based on the navigator object. |
Sample from PC MAGAZINE, JUNE 10, 1997 Vol. 16 No.11 Page 235-236 by William Robert Stanek executive director of Global Internet Solutions.
To show how you can use JavaScript in a Web page, I will create a basic utility that will get you started on the road to costomizing your Web site for individual browsers. The key to customizing pages for individual browsers is the navigator object.
The navigator object has four properties that can help you obtain information about a user's browser. These properties are appName, appCodeName, appVersion, and userAgent.
The appName property returns the official name of the user's browser, such as Netscape. The appCodeName returns the internal code name of the browser, such as Mozilla. AppVersion returns version information pertaining to the browser and includes the version number, platform, and country code, such as 4.0 (Win95;I). The userAgent property returns a combination of the appCodeName and appVersion data, such as Mozilla/4.0 (Macintosh; I; 68K).
This script sends the values of the navigator object's properties to a browser window (for security-reasons this only works offline), or after the user have select the browser info type, displays the selected info in an Alert Box.
But if your browser does not currently support JavaScript and if
you are using Internet Explorer 3.0 or higher or Netscape 2.0 or later
then you can enable
With
- Internet Explorer 5: Go to Tools Menu|Internet Options, Security Tab and click on the Custom Level. Then select disable active scripting under the scripting section.
- Netscape Version 4: Choose Edit|Preferences|Advanced, click Enable JavaScript and then click OK.
- Netscape Version 2 or 3: Choose Options|Network Preferences, choose the Languages tab, click Enable Javascript and then click OK.
You can see the JavaScript by using View Source.
|