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