I love Programming, and Eager to learn New things Curious about Microsoft Products, Interested in Knowledge sharing. If you can dream IT, You can become it, If you can think IT, You can do IT, If you can believe it, you can achieve IT.

How to detect browser & its version using javascript

Yesterday, one of my friend asked me how I can detect the browser & its version using javascript?

I suggested him to use $.browser. I wrote a sample code for him but when I tried to execute the code, it raised an error. $.browser is undefined. It was a bit surprise for me because I used it in several projects.
When I checked the jQuery documentation, I found that $.browser was removed in jQuery 1.9.

OK, no problem. I checked the Modernizr ( a JavaScript library that detects HTML5 and CSS3 features in the user’s browser ).