jquery出现问题。我无法从服务器获取.xml文件,使用jquery中的ajax函数。我试图在成功和错误时调用警报,但没有任何触发器。我这样做:JQuery返回码
$.ajax({
type: "GET",
url: "Levels.xml",
dataType: "xml",
error: function(){
alert("Ajax failed!");
},
success: function(xml){
alert(xml);
}
});
这没有奏效。 编辑:我有这样的代码在我的xml文件:
<?xmlversion="1.0" encoding="ISO-8859-1"?>
<Level id="TestLevel" theme="woods">
<Wall>
<Row>111111111111111111111</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>100000000000000000001</Row>
<Row>111111111111111111111</Row>
</Wall>
</Level>
你确定你调用摆在首位的功能? JavaScript控制台中的任何错误? – JJJ 2012-02-10 08:33:16
服务器是否看到请求?你确定代码甚至被执行吗? – nnnnnn 2012-02-10 08:33:22
没有错误信息。是的,它被称为 – B0nde 2012-02-10 08:34:07