Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check version of browser

How can i find what version of browser a user is using and ask him to upgrade it

like image 544
andrew Sullivan Avatar asked Jun 08 '10 13:06

andrew Sullivan


2 Answers

You can perform feature detection using jQuery, like this:

if (!jQuery.support.opacity)
    //Waah waah waah...

You can also check the browser version using jQuery, like this:

if (!jQuery.browser.msie && jQuery.browser.version === 6)
    //Waah waah waah...

However, it should be avoided where possible.

like image 184
SLaks Avatar answered Oct 12 '22 11:10

SLaks


You can read the HTTP_USER_AGENT from the Request.ServerVariables.

In ASP.NET that would be:

Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"]);

More info here

like image 24
Ralf de Kleine Avatar answered Oct 12 '22 11:10

Ralf de Kleine