I need to detect not only the browser type but version as well using jQuery. Mostly I need to find out if it is IE 8 or not.
I am not sure if I am doing it correctly
I think the best way would be this:
From HTML5 boilerplate:
in JS:
if( $("html").hasClass("ie8") ) { /* do your things */ };
especially since $.browser has been removed from jQuery 1.9+.