background
|
|
Games
Ruffnecks Gaming Gaming for everyone
More

Tombstone
Tombstone Tuning Home of tuning, projects and fast cars and boats.
More

Games
Ruffnecks Gaming Gaming for everyone
More

Tombstone
Tombstone Tuning Home of tuning, projects and fast cars and boats.
More
|
|
Up Image
Navigation
Search this Site
Enter your search terms

Site Breadcrumb - You are here
|
Reference   JavaScript Code Library

Usage: var bd = new BrowserDetector(navigator.userAgent);

This will create a new BrowserDetector object named "bd" with the following properties (see the demo page for examples using actual User-Agent strings):

  • bd.browser
  • bd.platform
  • bd.version
  • bd.majorver
  • bd.minorver

Example: The following would redirect users to two different pages depending on whether they were using a version of Netscape or Internet Explorer.

  var bd = new BrowserDetector(navigator.userAgent);
  if (bd.browser == "Netscape") {
    location = "ns_version.html";
  }
  else if (bd.browser == "IE") {
    location = "ie_version.html";
  }

Demo (All JavaScript browsers )

Cut, paste, and enjoy!