【发布时间】:2010-02-02 22:12:10
【问题描述】:
我试图拉入一个 xml 提要,我可以用 php 和 simpleXML 加载它,我可以查看直接链接,但是当我尝试使用 jquery 并 GET 它只是超时并且我从未得到响应时,错误返回的是未定义的。
这是我正在使用的代码
$.ajax({
type: "GET",
url: "myurlishere",
dataType: "xml",
timeout: 1000,
contentType: "text/xml",
success: function(xml) {
alert("in");
},
complete: function(XMLHttpRequest, textStatus) {
alert(textStatus);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
});
【问题讨论】: