我在使用$ .ajax之前首先创建一个普通对象。所以我可以在加载之前添加其他键/值来配置请求:
var options = {
type: "GET",
url: url,
dataType: 'json',
cache: false,
success: function(msg){
alert('This works!');
cfunc(msg);
delete xmlPool[key];
}
};
xhr = $.ajax(options);
可悲的是,没有'这个有效!'消息显示...感谢您的帮助!
答案 0 :(得分:1)
值得添加一个错误块来检查是否发生了一些错误?
error: function (e, textStatus, errorThrown) {
alert(errorThrown);
}