• <small id='FvYGN'></small><noframes id='FvYGN'>

    <legend id='FvYGN'><style id='FvYGN'><dir id='FvYGN'><q id='FvYGN'></q></dir></style></legend>

      <tfoot id='FvYGN'></tfoot>

      • <bdo id='FvYGN'></bdo><ul id='FvYGN'></ul>

        <i id='FvYGN'><tr id='FvYGN'><dt id='FvYGN'><q id='FvYGN'><span id='FvYGN'><b id='FvYGN'><form id='FvYGN'><ins id='FvYGN'></ins><ul id='FvYGN'></ul><sub id='FvYGN'></sub></form><legend id='FvYGN'></legend><bdo id='FvYGN'><pre id='FvYGN'><center id='FvYGN'></center></pre></bdo></b><th id='FvYGN'></th></span></q></dt></tr></i><div id='FvYGN'><tfoot id='FvYGN'></tfoot><dl id='FvYGN'><fieldset id='FvYGN'></fieldset></dl></div>
      1. Firefox 异常'JavaScript 组件没有名为:“可用&qu

        时间:2023-10-14

          <legend id='ZADm7'><style id='ZADm7'><dir id='ZADm7'><q id='ZADm7'></q></dir></style></legend>
            <bdo id='ZADm7'></bdo><ul id='ZADm7'></ul>
          • <small id='ZADm7'></small><noframes id='ZADm7'>

              <tbody id='ZADm7'></tbody>

              <i id='ZADm7'><tr id='ZADm7'><dt id='ZADm7'><q id='ZADm7'><span id='ZADm7'><b id='ZADm7'><form id='ZADm7'><ins id='ZADm7'></ins><ul id='ZADm7'></ul><sub id='ZADm7'></sub></form><legend id='ZADm7'></legend><bdo id='ZADm7'><pre id='ZADm7'><center id='ZADm7'></center></pre></bdo></b><th id='ZADm7'></th></span></q></dt></tr></i><div id='ZADm7'><tfoot id='ZADm7'></tfoot><dl id='ZADm7'><fieldset id='ZADm7'></fieldset></dl></div>

            • <tfoot id='ZADm7'></tfoot>
                  本文介绍了Firefox 异常'JavaScript 组件没有名为:“可用"的方法'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在使用 Django 构建一个 Web 应用程序.我通过 Ajax (jQuery v1.8.3) 在 Javascript 中有一堆 API 调用.

                  I'm building a web app with Django. I have a bunch of API calls in Javascript via Ajax (jQuery v1.8.3).

                  它们中的大多数都有效,但特定的一个会导致返回对象的状态为 0,并且此消息作为 statusText:

                  Most of them work, but a particular one results in a return object with status 0 and this message as the statusText:

                  [Exception...'JavaScript 组件没有名为:available"'的方法,调用方法时:[nsIInputStream::available]"nsresult:0x80570030(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"位置:JS 框架:: http://127.0.0.1:8000/media/js/jquery.js :: .send :: line 8434" 数据:无]

                  jQuery中对应的行是xhr.send((s.hasContent && s.data)|| null);

                  The corresponding line in jQuery is xhr.send( ( s.hasContent && s.data ) || null );

                  但是,这只发生在 Firefox 中.铬工作正常.同样,其他请求确实有效.唯一让这个与众不同的是 DELETE http 方法.

                  However, this occurs only in Firefox. Chrome works fine. Again, other requests do work. The only thing which sets this one apart is the DELETE http method.

                  请求如下(Chrome 中显示的 HTTP 网络数据 - Firebug 在 Firefox 中不显示任何内容):

                  The request is as follow (HTTP network data shown in Chrome – Firebug doesn't show anything in Firefox):

                  Request URL: http://127.0.0.1:8000/api/reservation/13/
                  Request Method: DELETE
                  Status Code: 400 BAD REQUEST    (This is expected)
                  
                  Request Headers
                  Accept: application/json, text/javascript, */*; q=0.01
                  Content-Length: 15
                  Content-Type: application/json
                  Origin: http://127.0.0.1:8000
                  Referer: http://127.0.0.1:8000/reservation/
                  X-Requested-With: XMLHttpRequest
                  
                  Request Payload
                  [object Object]
                  
                  Response Headers
                  Cache-Control: no-cache
                  Content-Type: text/html; charset=utf-8
                  Date: Tue, 02 Apr 2013 19:18:35 GMT
                  Server: WSGIServer/0.1 Python/2.7.2
                  

                  在服务器上,我没有收到任何请求.

                  On the server, I don't receive any request.

                  JS 代码是(在断点处直接取自 Firebug Watch):

                  The JS code is (taken directly from Firebug Watch at breakpoint):

                  options = {
                      contentType: "application/json",
                      data: Object {},
                      dataType: "json",
                      processData: false,
                      type: "DELETE",
                      url: "/api/reservation/13/",
                      error: function(),
                      success: function()
                  };
                  $.ajax(options);
                  

                  我也曾尝试禁用 FF 中的所有扩展.我运行 v20.0.

                  I also did try to disable all extensions in FF. I run v20.0.

                  推荐答案

                  问题是 Firefox 与 jQuery/XMLHttpRequest 的组合以及通过 HTTP DELETE 发送对象.一旦通过 JSON.stringify() 对对象进行 JSON 化,一切正常.

                  The problem was a combination of Firefox with jQuery/XMLHttpRequest and sending an object via HTTP DELETE. Once JSON'ifying the object via JSON.stringify() everything worked.

                  不过,Firefox 会抛出一个奇怪的异常.

                  Still, a strange exception for Firefox to throw.

                  感谢 freddyb 的这个想法.

                  Thanks to freddyb for that idea.

                  这篇关于Firefox 异常'JavaScript 组件没有名为:“可用"的方法'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Node js/Angular js - 注意:显示临时标题 下一篇:Service Worker 可以响应同步的 XHR 请求吗?

                  相关文章

                  最新文章

                1. <i id='g80DY'><tr id='g80DY'><dt id='g80DY'><q id='g80DY'><span id='g80DY'><b id='g80DY'><form id='g80DY'><ins id='g80DY'></ins><ul id='g80DY'></ul><sub id='g80DY'></sub></form><legend id='g80DY'></legend><bdo id='g80DY'><pre id='g80DY'><center id='g80DY'></center></pre></bdo></b><th id='g80DY'></th></span></q></dt></tr></i><div id='g80DY'><tfoot id='g80DY'></tfoot><dl id='g80DY'><fieldset id='g80DY'></fieldset></dl></div>

                  <small id='g80DY'></small><noframes id='g80DY'>

                2. <tfoot id='g80DY'></tfoot>

                    • <bdo id='g80DY'></bdo><ul id='g80DY'></ul>

                    <legend id='g80DY'><style id='g80DY'><dir id='g80DY'><q id='g80DY'></q></dir></style></legend>