我编写了一个jQuery脚本,它可以在 Chrome、Firefox 和 Opera 中运行,但不能在 Internet Explorer 9 中运行。
基本上,使用 ajax 在后台加载的图像应该淡入淡出并被动态替换,因为其他图像上传到同一文件夹中。在 Internet Explorer 中,脚本无法正常工作并且图像未加载。
我尝试使用 firebug 和 IE 开发人员工具栏进行调试,但我有点缺乏经验。
你能帮我吗?谢谢!
jQuery代码
$(window).load(function () {
    var data;
    $('.nascosto').hide();
    $('.ciccio').hide();
    $.ajax({
        type: "GET",
        url: "phpdelete.php",
        success: function (data) {
            $("<img/>").attr("src", data).load(function () {
                $(this).remove();
            });
        }
    });
    setInterval(prova, 1000);
    function prova() {
        $.ajax({
            type: "GET",
            url: "phpdelete.php",
            success: function (data2) {
                if (data2 != data) {
                    $('.ciccio').fadeOut(2000, function () {
                        $("<img/>").attr("src", data2).load(function () {
                            $(this).remove();
                            $('.ciccio').css('background-image', 'url(' + data2 + ')').delay(500).fadeIn(2000);
                            data = data2;
                        });
                    });
                }
            }
        });
    }
});