[英]AJAX call results in status 0
$.ajax({
url:"myurl",
async:true,
success:function (data) {
//....
},
complete:function (x, st) {
//....
},
error:function (x, st, e) {
alert(JSON.stringify(x));
}
});
這是ajax調用。 如果我嘗試在瀏覽器中訪問“ myurl”,則可以正常工作。 但是Ajax調用始終會導致錯誤。 如果我對xhr進行字符串化,則如下所示:
{
"readyState": 0,
"responseText": "",
"status": 0,
"statusText": "error"
}
這些URL可能在重定向的地方出現問題-只有1個留在域中:
http://www.barnesandnoble.com/s?keyword=9780735619678&store=ebook #->
http://www.barnesandnoble.com/...
http://www.barnesandnoble.com/s?keyword=9780201485677&store=ebook #->
http://search.barnesandnoble.com/...
您需要在權限中包含search.barnesandnoble.com
:
"permissions": [
"http://www.barnesandnoble.com/",
"http://search.barnesandnoble.com/"
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.