jquery和IE6如何测试问题

时间:2012-01-05 18:17:31

标签: jquery internet-explorer-6

我在IE6上遇到jquery问题,我不知道如何检查问题是什么。 IETester似乎没有这个功能。还有什么可以进行测试吗?

好的我正在显示一些应该删除员工的代码。这在IE6中不起作用:

$(".delete").click(function() {
                $(this).next('.loading').fadeIn();

                var commentContainer = $(this).parent();
                var id = $(this).attr("id");
                var string = 'solutionID='+ id;

                $.ajax({
                   type: "POST",
                   url: "/js/ajax/delete-comment.php",
                   data: string,
                   cache: false,
                   success: function(){
                    commentContainer.slideUp('slow', function() {$(this).remove();});
                    $('.loading').fadeOut();
                  }

                 });

                return false;
                });

5 个答案:

答案 0 :(得分:2)

答案 1 :(得分:1)

通常,您可以尝试找到出现错误的函数:

alert();

这很烦人,但通常不需要那么多时间。

答案 2 :(得分:0)

Microsoft安装了IE6的Windows XP VHD映像,用于测试/调试;你应该尝试使用它。

此外,确保在VM启动并运行后将IE Developer工具栏安装到IE6中;将使调试更容易。

答案 3 :(得分:0)

我试用了你的代码,它也适用于IE。我只是做一些凹痕。你有什么错误?

$(".delete").click(function(event) {
  var item = $(this),
      commentContainer = item.parent(),
      id = item.attr("id"),
      string = "solutionID=" + id;

  item.next(".loading").fadeIn();

  $.ajax({
    type: "POST",
    url: "/foo.php",
    data: string,
    cache: false,
    success: function(){
      commentContainer.slideUp("slow", function() {
        item.remove();
        $(".loading").fadeOut();
      });
    }
  });
  event.preventDefault();
});

演示:http://brbforum.de/stackoverflow_ie6_ajax_test.html

答案 4 :(得分:0)

您可以下载scd10en.exe,Microsoft脚本调试程序。它能够从控制台逐步执行脚本,设置断点和运行命令。