我正在尝试使用jquery将asmx web服务数据显示到div。我无法让它工作,它给出了以下代码的解析错误。 Here is my fiddle:
Webservice:http://www.webservicex.net/stockquote.asmx
$.ajax({
type: "post",
url: "http://www.webservicex.net/stockquote.asmx?op=GetQuote",
contentType: "application/xml; charset=utf-8",
dataType: "xml",
data: "4",
success: function (xml) {
$(xml).find('StockQuotes').each(function () {
var title = $(this).find('Symbol').text();
var created = $(this).find('Date').text();
alert(title);
});
},
error: function (msg, m2, m3) {
alert(m2);
}
});