【发布时间】:2012-11-28 17:35:41
【问题描述】:
我想在网站上发送一个 ajax 请求,但结果很奇怪:
$.ajax({
type: 'GET',
url: 'http://mydomain.com/test.json',
success: function(data){
console.log(data);
alert('Ok');
},
error: function(data){
console.log(data.responseText);
alert('FAIL !!!');
}
});
test.json 是
{
ttt: 1,
ttt: 3,
test:{
aa: 1,
bb: 2
}
}
所以我的警报失败了,但我的 console.log 我有我的 json 文件的内容
为什么错误返回结果??
谢谢
【问题讨论】: