I’ve a simple script to test the browser version. I wrote a simple standalone testing page to test it. When tested on IE 9 it alerted the rigth version 9. The same script whent used in my actual page gives me a different result when tested on the same IE9 browser. (It alerts me with the value 7.
I’m confused. Does anyone have any insight?
<script>
if ( $.browser.msie ) {
alert( parseInt($.browser.version, 10) );
}
</script>
I’ve a modal issue for ie 7 and below. I need to check the version and do accordingly
Why are you detecting the browser? That is very strongly discouraged most of the time.
It’s better is to use
jQuery.support().To answer your question it could be that IE9 is working in compatibility mode, where it pretends to be an older browser.
Did you include a
DOCTYPEin your page?