I have a js file and would like to run some code only if the browser is IE 8. Is there a way I can do this?
Right now I only have this but it's for all ie browsers:
if ($.browser.msie) {
//do stuff for IE 8
}
I have a js file and would like to run some code only if the browser is IE 8. Is there a way I can do this?
Right now I only have this but it's for all ie browsers:
if ($.browser.msie) {
//do stuff for IE 8
}
Try using like this
You can do something like this:
See Browser detection in JavaScript? and http://modernizr.com
Here is the short(est?) answer: