Wednesday, October 15, 2008

Browser Detection

The JavaScript Navigator object contains all information about the visitor's browser. We are going to look at two properties of the Navigator object:
• appName - holds the name of the browser
• appVersion - holds, among other things, the version of the browser

Insert the Following code inside the body tag.

var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
document.write("Browser name: "+ browser);
document.write("<br />");
document.write("Browser version: "+ version);
Run that page in all browser you can note the diferrence.

No comments: