0

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

user829174
  • 6,132
  • 24
  • 75
  • 125
  • possibly duplicate question: take a look [here](http://stackoverflow.com/questions/12769223/how-to-show-different-pages-for-different-versions-of-ie/12769302#12769302) – Hashem Qolami Oct 16 '12 at 09:42

3 Answers3

1

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.

VisioN
  • 143,310
  • 32
  • 282
  • 281
1

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... 
}
1

use this site:

http://www.browser-update.org

can customize the css as required

  • 1
    Giving only link as answer is not a good way. If link is updated or remove in future, you answer will become invalid automatically. It would be better if you give some explanation and then give link as reference. – Sankumarsingh Sep 05 '13 at 19:38