【发布时间】:2012-05-11 05:37:20
【问题描述】:
我在从文件加载 JSON 内容时遇到了困难。 console.log 打印 "server-side failure with status code 0",表示请求失败。
我的 JSON 文件 URL 正确,并且文件存在于给定地址。
Firebug 显示错误:
"NetworkError: 405 Not Allowed - http://localhost:8080/4910.json?_dc=1336714070619
并且网络标签显示状态405 not allowed。
关于为什么会发生这种情况的任何想法?
Ext.Ajax.request({
url: 'http://localhost:8080/4910.json',
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
console.log(obj[0].name);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
另外,在 GET 请求的末尾添加参数_dc=1336714070619 是什么?
【问题讨论】: