Now we will discus and learn that a useful but repeatedly overrated
JavaScript function is the browser detection
here in JavaScript Tutorial.
Sometimes we need to give specific instructions or load a new page in case the
viewer uses, for instance, search etc.
The worst mistake that JavaScript beginners make is to use Browser Detection
to determine what JavaScript code to run on which browser, this is can be a
mistake because some browsers support JavaScript and some did not support. The problem with doing this
is that there are hundreds of different browsers that we would really need to test for
in order to get the code exactly right with new versions being introduced just about every
day have we updated our browser detection JavaScript to recognize today's new
browser versions? If not then it would be very harmful for our website.
When people do use such a JavaScript they usually just test for the two or three most commonly
used browsers and totally stuff up the webpage for anyone using a less common
web browser.
Even with the web browsers that they do cater for a lot of work is required to recode the
JavaScript
every time a new version of one of those web browsers comes out with different functionality,
support of JavaScript.