user829174
user829174

Reputation: 6362

How to detect browser version and display not supported message

How to detect browser version and display not supported message I would like to support only IE9 and above and Chrome

Upvotes: 0

Views: 3416

Answers (3)

peter parker
peter parker

Reputation: 11

use this site:

http://www.browser-update.org

can customize the css as required

Upvotes: 1

Danny Roodbol
Danny Roodbol

Reputation: 11

You can put conditional comments in the HEAD tag to create variables that indicate if you have an IE browser.

<script type="text/javascript">
    var supportedBrowser = 1;
</script>
<!--[if lte IE 8]><script>var supportedBrowser=0;</script><![endif]-->

Now if you do not have an IE browser or if you have IE8 or lower, supportedBrowser == 0, so you can use a simple if-statement:

if(supportedBrowser != 1){   
    // do whatever you want here... 
}

Upvotes: 1

VisioN
VisioN

Reputation: 145388

I suggest you to check $.support which stands for:

A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.

Previously there was $.browser property which was useful for checking the browser version. However, nowadays it is deprecated due to inconsistency.

Upvotes: 1

Related Questions