Invalid Domain
You are here :
Javascript Code Library |
JavaScript Code Library
In order to deal with the many different browsers in use on the Web you need a way for your scripts to tell them apart. Luckily all browsers "announce" themselves with the User-Agent property, although it can be a pain to keep all the variations apart. The BrowserDetector function isolates the potentially useful portions of the User-Agent string so you can go about the business of making Web pages that work for all browsers.
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):
Example: The following would redirect users to two different pages depending on whether they were using a version of Netscape or Internet Explorer.
Demo (
Cut, paste, and enjoy!
SUBMISSIONS Can't find something?
|