2
在我的節點js文件,我有這樣的代碼:獲取協議
var jqxhr = $.getJSON("favs.json", function() {
console.log("success");
})
.done(function() {
console.log("second success");
})
.fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.log("Request Failed: " + err);
})
.always(function() {
console.log("complete");
});
而在服務器有一個在同一個目錄中稱爲favs.json
文件上面的js文件。但是,當我訪問該頁面時,出現錯誤:
Request Failed: error, Protocol not supported.
有誰知道最新錯了嗎?
謝謝。
在服務器上我們讀取文件不是getJSON getJSON用於前端 – Gaurav