I have a WordPress website and I have installed one plugin and the plugin has some problems in IE6 browser.

So, I want to disable that jQuery plugin when the page is viewed with the IE6 browser.

So now I need a jQuery statement to disable ALL other statements that are loading from other JS files.

有帮助吗?

解决方案

use Downlevel-revealed conditional comments :

<!--[if lte IE 6]><![if gte IE 7]><![endif]-->

<!-- keep your script in between these two comments, 
it will work in all browser except ie -->

<!--[if lte IE 6]><![endif]><![endif]-->

Explained here : Hiding some HTML from IE6?

其他提示

I'm not entirely sure why IE6 is even on your agenda, but to each their own.

If it were me I would write something like this.

<!doctype html>
    <!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->....
    .....


(function ($) {
    "use strict";

    // Detect IE 6
    var greatGreatGranddadsBrowser;
    if ($('html').is('.ie6')) {
        greatGreatGranddadsBrowser = true;
    }

    if (greatGreatGranddadsBrowser) {
        // Remove the elements that you don't want loaded
        // Tell the users to seriously consider coming into the real world
    } else {
        // Do whatever else you need to do 
    }

}(jQuery));
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top