在Firefox中未发送Ajax请求未知错误

在Firefox 27.0.1,Fedora 20,jQuery 1.11.0中执行此GET同步ajax请求时:

$.ajax(ajaxParam).then( function (r) { html = r.html; }, function (jqXHR) { console.log(JSON.stringify([jqXHR, $.ajaxSettings, ajaxParam], null, 4)); } ); 

它适用于Linux的Chrome 33.0.1750.146但在Firefox中没有请求发送到服务器并且它出错:

 [ { "readyState": 0, "status": 0, "statusText": "[Exception... \"\" nsresult: \"0x805e0006 ()\" location: \"JS frame :: http://example.com/static/jquery-1.11.0.min.js :: .send :: line 4\" data: no]" }, { "url": "http://example.com/pt/BR", "type": "GET", "isLocal": false, "global": true, "processData": true, "async": true, "contentType": "application/x-www-form-urlencoded; charset=UTF-8", "accepts": { "*": "*/*", "text": "text/plain", "html": "text/html", "xml": "application/xml, text/xml", "json": "application/json, text/javascript", "script": "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, "contents": { "xml": {}, "html": {}, "json": {}, "script": {} }, "responseFields": { "xml": "responseXML", "text": "responseText", "json": "responseJSON" }, "converters": { "text html": true }, "flatOptions": { "url": true, "context": true }, "jsonp": "callback", "cache": false, "traditional": true, "dataType": "json" }, { "url": "/advert/pt/BR", "data": { "realty_id": "2" }, "async": false, "type": "GET" } ] 

nserror 0x805e0006是NS_ERROR_CONTENT_BLOCKED


回答epascarello

那个ajax调用就在这个函数里面

 function popupOpen(params, page, html) { loadScripts(); var ajaxParam = { url: '/' + page.url + '/' + $('#lang_code').val() + '/' + $('#terr_code').val(), data: params, async: false, type: page.method, traditional: false }, realtyId = params.realty_id; if (!html) { $.ajax(ajaxParam).then( function (r) { html = r.html; }, function (jqXHR) { console.log(jqXHR, $.ajaxSettings, ajaxParam); } ); } 

和popupOpen由Google地图中的点击监听器调用

 gm.event.addListener(marker[realtyId], 'click', function () { infoWindow[realtyId].open(map, marker[realtyId]); popupOpen({ realty_id: realtyId }, realtyId === 0 ? pageO.modify : pageO.advert); }); 

由于目标urladvert世界Adblock Plus阻止了它。 在投入生产之前,它发生在我身上。

我在node.js中遇到了类似的问题,我的路由是/ api / getads,AJAX调用在它进入服务器之前就遇到了错误逻辑。 将路由URL更改为/ api / getspn(赞助商的简称)修复了该问题。

不要使用包含“广告”的url或路由,因为它会与Firefox的反广告插件冲突。