Chinovski Chinovski - 1 year ago 116
jQuery Question

How to not to execute a script on IE8 or older?

I have a function that calls many functions which are not supported by IE8, so I am looking for how to disable executing this script for IE8. I saw many solutions like using HTML comments:

<!--[if !IE]> --> Code <!-- <![endif]--><!--[if IE]>

But I want disabling IE8 interpretation inside a function, because there are other scripts that run correctly on IE8.

There is a function in jQuery "jQuery.browser()" but it has been deprecated.

Could you please tell me how to resolve this issue?

Thank you in advance.

Answer Source

Maybe this will help:

if (navigator.userAgent.match(/MSIE 8/) == null) {
  // do something !IE8


how do I run a script only for IE 8

Browser detection in JavaScript?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download