The Navigator Object

The navigator object can be used to report information about the user's web browser
and what computer or device they are using to visit your website. Shown below are some
of the most useful navigator object properties.

Property

Description

appCodeName

code name of browser

appName

browser name

appVersion

browser version

cookieEnabled

are cookies enabled?

platform

computer or device

userAgent

information about itself browser sends to website

Shown below is code that displays some of the navigator object property values
in a message box.

Because mobile devices have only a small screen some websites redirect their webpage
requests to a webpage specialy designed for small screens. Shown below is code that
examines the navigator object's user-Agent property to detect some mobile devices and
redirect the web browser.

The code uses regular expressions to find mobile devices names in the user-Agent
string. The i option means the expression is case-insensitive.

There are many more user-Agent properties than listed here, but there is no
standard as to which ones are available in different browser versions, and the data
contained in the properties is also unreliable.