| Browser
Sniffing - B/V/P Method The Browser/Version/Platform method (B/V/P for short) seems to be the first method used historically. In most cases, it is only as effective as your knowledge of the characteristics of the different browsers. The B/V/P method does have the advantage if you know that at least theoretically a browser supports some form of functionality but that support is broken in some way. Generally, I use this method only as a backup to the functionality method described on the next page. So how does this work? Each browser contains information available to javaScript in the "navigator" object that describes the browser, the browser version and the platform that your reader is using. The navigator object contains much more information than we need, but for our purposes, we can confine our search to three properties: navigator.appName is a string that contains the name of the browser, navigator.appVersion is a string that contains information in the format version (detail; detail [; detail[; ...]]) navigator.platform is a string that contains the name of the platform For instance, the browser you are using right now returns the following three strings:
Armed with this information, we can now go on to write a short function that will give us the information we are seeking. Continue |
| © 1999
bnsDesigns |