HTML and CSS Reference
What Is Your Browser's Name? Version Number? Browsers support different
features, properties, and methods; for example, Internet Explorer might display a page
in a slightly different form than Firefox, one version of Mozilla might support a feature
not supported by an older version, a version of Internet Explorer might not support a
feature supported by Opera, and so on. If you take into consideration all the other
browsers and their unique features, it can be tricky to please all of the browsers all of the
time or even some of the browsers all of the time. Browser detection allows you to check
for specific browser names, versions, whether cookies are enabled, what types of plug-
ins are loaded, and so on. The navigator object contains a number of properties that
allow you to detect information about the user's browser so you can customize your Web
page in a way that is transparent to the user.
<head><title>The Navigator Object</title></head>
<h2>About The Browser</h2>
var BrowserName= navigator.appName;
var BrowserVersion = navigator.appVersion ;
var BrowserAgent= navigator.userAgent ;
document.write("<b>The Browser's name is:</b> " +
BrowserName + "<br />");
document.write("<b>The Browser version is:</b> " +
BrowserVersion + "<br />");
document.write("<b>The Browser's \"user agent\" is:</b> " +
BrowserAgent + "<br />");
document.write("<b>The Browser's platform is:</b> " +
platform + "<br />");
The navigator object's appName property is the browser's name.
The navigator object's appVersion property is the version of the browser.
The userAgent property refers to the HTTP user-agent header sent from the brows-
er to server.
What Is a Browser Sniffer? A browser sniffer is a program that makes browser
detection easy. Many Web sites provide free browser sniffers that determine the types of