我試圖構建褻瀆過濾API。 api的響應將以JSON形式發佈。我正在使用以下代碼訪問api。但是,它顯示了一些我無法弄清楚的錯誤。這個JSONP請求有什麼問題
這裏是我的代碼..
$.ajax({
dataType: 'jsonp',
jsonp: 'callback',
url: 'http://www.employeeexperts.com/Profanity/index.php/rest/check/Good Morning',
success: function(data) {
console.log('success');
console.log(JSON.stringify(data));
},
error: function (header, status, error) {
console.log('ajax answer post returned error ' + header + ' ' + status + ' ' + error);
}
});
問候
目標應用程序不列入似乎支持JSONP –
@ArunPJohny你說「不列入似乎支持JSONP」的意思。因爲,如果你只執行url,你可以看到它返回JOSN字符串。 – mi6crazyheart
什麼是整點,如果支持jsonp將不會返回一個簡單的'json'它通過包裝在一個函數調用中返回它,其名稱將通過'callback'參數指定 –