【问题标题】:jquery and IE6 how to test problemsjquery和IE6如何测试问题
【发布时间】:2014-02-25 07:54:32
【问题描述】:

我在 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;
                });

【问题讨论】:

  • 你能不能比“我遇到问题”更具体一点。
  • @AaronS:对于 IE6,很难更具体。错误并没有太大帮助。
  • 尝试使用Firebug Lite 来帮助您。
  • 它是一个ajax jquery脚本,用于添加和返回结果表单数据库。它适用于除 IE6 之外的其他任何地方。我只是在寻找一种方法来找出问题在 IE6 中的位置。
  • @Rocket:但是,他可以添加信息,例如他正在尝试做什么、发布无效的代码等。如果唯一的信息是“我有问题”

标签: jquery internet-explorer-6


【解决方案1】:

【讨论】:

    【解决方案2】:

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

    alert();
    

    这很烦人,但通常不会花费那么多时间。

    【讨论】:

      【解决方案3】:

      Microsoft 制作安装了 IE6 的 Windows XP VHD 映像以用于测试/调试目的;您应该尝试改用它。

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

      【讨论】:

        【解决方案4】:

        我试用了您的代码,它也适用于我的 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

        【讨论】:

        【解决方案5】:

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多