Browser Detection in Practice


There are a few problems using browser detection the way it has been described up to this point. First, you must make sure JavaScript can even be executed; you may want to do some basic browser detection using server-side technologies that look at the user-agent string and then probe more deeply using JavaScript, if it is available. Another problem is that, so far, all the hard detection work is carried out anew for each page the user loads. Ideally, you should save this information to a cookie and then detect only those features that have changed. You will also have to make sure your detection capabilities are failure-proof by considering all the things that could go wrong: scripting being off, a new browser version hitting the market, and so on. Last, you ll have to be a browser capabilities expert, which is difficult given the number of browsers currently in use. Just counting the major versions of major browsers, there are literally dozens of distinct browsers commonly used, and there is a great deal of information to deal with, especially considering older browsers and the emerging device-based browsers on cell phones and PDAs. Fortunately, help is out there. Consider looking into browser detection such as BrowserHawk ( www.browserhawk.com ).




JavaScript 2.0
JavaScript: The Complete Reference, Second Edition
ISBN: 0072253576
EAN: 2147483647
Year: 2004
Pages: 209

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net