Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
以下JQuery和Javascript在Internet Explorer 6以后的版本中无法正常工作_Jquery_Ajax_Internet Explorer_Html_Replace - Fatal编程技术网

以下JQuery和Javascript在Internet Explorer 6以后的版本中无法正常工作

以下JQuery和Javascript在Internet Explorer 6以后的版本中无法正常工作,jquery,ajax,internet-explorer,html,replace,Jquery,Ajax,Internet Explorer,Html,Replace,你知道为什么下面的代码不会在IE6和IE8中持续更新,但在Chrome和FF中却可以很好地工作吗 $(document).ready(function () { window.setInterval(function () { $('div').each(function (index, item) { var vm = $(item).text(); var env = "some u

你知道为什么下面的代码不会在IE6和IE8中持续更新,但在Chrome和FF中却可以很好地工作吗

$(document).ready(function () {

        window.setInterval(function () {

            $('div').each(function (index, item) {

                var vm = $(item).text();
                var env = "some url (cant show)";

                $.ajax(env, {
                    URL: env,
                    type: "GET",
                    dataType: "html",
                    success: function (data) {                          
                        var style = $(data).filter('div');
                    $(item).replaceWith(style);

                    },
                    error: function () {
                        $(item).css('background', '#f00');
                    }
                });
            });
        }, 10000);
});
div将改变一次,然后再也不会改变。然而,在Chrome和FF中,div也会每隔10秒更改一次


谢谢你的帮助

尝试编写脚本,就像(没有测试它)


我还必须注意,我确实缓存了:false,-排除了双引号。嗯,尝试添加$.ajaxSetup({cache:false});在您的ajax函数之上。也许它会奏效。如果不比不知道你还能做什么:(也尝试过这个-仍然没有乐趣!如果你能尝试将“GET”改为“POST”?)?
    $(document).ready(function () {

    window.setInterval(function () {

        $('div').each(function (index, item) {

            var vm = $(item).text();
            var env = "some url (cant show);

            $.ajax(env, {

                URL: env,

                type: "GET",

                cache:"false", //NOTICE FALSE!!

                dataType: "html",

                success: function (data) {


                    var style = $(data).filter('div');
                    $(item).replaceWith(style);

                },

                error: function () {



                    $(item).css('background', '#f00');

                }

            });
        });

    }, 10000);

});`