How to get the browser information using javascript?

Posted by Hanishani under JavaScript on 9/24/2013 | Points: 10 | Views : 1994 | Status : [Member] | Replies : 4
hai all,

How to get the browser information like which browser they were using and browser version using javascript.

Thanks in Advance.




Responses

Posted by: Bandi on: 9/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript
http://web-design-lessons.com/articles/article/1/JavaScript%20Browser%20Detection
NOTE:
It is always best to avoid browser-specific code entirely where possible. The JQuery $.support property is available for detection of support for particular features rather than relying on browser name and version.

In Opera for example, you can fake an internet explorer or firefox instance.
A detailed description of JQuery.support can be found here: http://api.jquery.com/jQuery.support/

When coding websites, i always make sure, that basic functionality like navigation is also accessible to non-js users. This may be object to discussion and can be ignored if the homepage is targeted to a special audience.



Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
JAVASCRIPT CODE TO DETECT BROWSER VENDOR, VERSION, AND OPERATING SYSTEM

Refer "JAVASCRIPT CODE TO DETECT BROWSER VENDOR, VERSION, AND OPERATING SYSTEM " section in the link http://hea-www.harvard.edu/~fine/CFA/browser_type.html

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
For Browser Type:

navigator.sayswho= (function(){
var ua= navigator.userAgent,
N= navigator.appName, tem,
M= ua.match(/(opera|chrome|safari|firefox|msie|trident)\/?\s*([\d\.]+)/i) || [];
M= M[2]? [M[1], M[2]]:[N, navigator.appVersion, '-?'];
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
return M.join(' ');
})();



navigator.appVersion retunrs Browser Version

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer links
http://www.javascriptkit.com/javatutors/navigator.shtml
http://chiragrdarji.wordpress.com/2008/09/02/how-to-detect-browser-using-javascript/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response