【问题标题】:(Uncaught TypeError: Object #<XMLHttpRequest> has no method 'always') and (Uncaught TypeError: Object #<Object> has no method 'delay')(Uncaught TypeError: Object #<XMLHttpRequest> has no method 'always') and (Uncaught TypeError: Object #<Object> has no method 'delay')
【发布时间】:2014-01-25 18:33:00
【问题描述】:

大家好,请问是什么原因导致了这个错误?

  1. “未捕获的类型错误:对象#没有方法 '总是'"
  2. “未捕获的类型错误:对象 # 没有方法‘延迟’”

这些错误仅在我的 Google Chrome Beta (33.0.1750.46 beta-m) 上显示,并且适用于 Firefox Beta(27) 和 Internet Explorer 11。

我正在使用 jQuery 1.10.2。

我刚刚按照 API 使用 jQuery 文档中的方法。

以下是示例代码:

  1. http://goo.gl/0C0UBQ

    process = $.post(uri, { "input[]": [code, input, apiLangID, postID, type] },
        function(data) {
            // MY CODES HERE
        }, "json")
        .always(function() {
            hide_abort_btn();
            isCompiling = false;
        });
    
  2. http://goo.gl/JHYvNX

    var delayDuration = 20000;
    
    $("#helper-dialog").fadeIn().delay(delayDuration).fadeOut();
    
    $("#helper-dialog").append("<p><span>" + mes + "</span></p>");
    

【问题讨论】:

  • console.log($.fn.jquery) 这给了你什么?
  • 您似乎使用的是非常旧的 jQuery 版本(1.4 之前的版本)。不知何故,这似乎只适用于您的 Chrome Beta 浏览器
  • google 扩展是否可以覆盖网页中包含的 jquery 实例?
  • @KevinB - 它显示“1.10.2”
  • @Phil - 我正在使用最新的 jQuery

标签: jquery ajax google-chrome


【解决方案1】:

看来问题出在我的一个 chrome 扩展程序上……

首先,按照 KevinB 的建议,我切换到隐身模式并禁用了扩展。

接下来,我通过启用扩展来调试它,直到找到罪魁祸首(Tamper Monkey)...

然后,我只是将它从 Chrome 中删除,我的脚本现在可以正常运行了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-20
    • 2013-03-13
    • 2013-01-18
    相关资源
    最近更新 更多