【发布时间】:2011-11-22 00:31:44
【问题描述】:
我尝试使用 jquery 根据 read xml by jquery 获取 asp 生成的 xml 文件,但我得到 status = parsererror err = TypeError: data is null。在浏览器中输入 xml 文件会生成一个非常好的 xml 文件。我希望我不必做 wget...
xmlhttp = "http://10.1.10.154:1014/dtsearch_2.asp?cmd=pdfhits&DocId=44&Index=C%3a%5cstream%5cSupport%5cIDX%5fESTATE&HitCount=4&hits=185+1ac+1d5+1ff+&hc=323&req=knife"
$.ajax({
url: xmlhttp,
method: "POST",
dataType: "xml",
success: function(data) {
var xdoc = $(data); // Note that jQuery has already done the parsing for us
alert("Getting tutorials");
var tutorials = xdoc.find("loc");
alert("Found: " + tutorials.length);
tutorials.each(function() {
alert("Tutoral author: " + $(this).attr("pg"));
});
},
error: function(jxhr, status, err) {
alert("Ajax error: status = " + status + ", err = " + err);
}
});
我使用本地 IP 地址和端口 1014,但我不明白为什么这会很重要...
谢谢, 尼克
【问题讨论】:
标签: jquery xml ajax asp-classic