我正在尝试使用$ .get方法从此Web服务获取xml数据: http://www.webservicex.net/currencyconvertor.asmx?op=ConversionRate
我在尝试获取数据时收到错误。
示例代码:
var FromCurrency = "USD";
var ToCurrency = "JMD";
var url = "www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency="+FromCurrency+"&ToCurrency="+ToCurrency;
var jqXHR;
alert(url);
jqXHR = $jQuery.get(url,function(data){
alert(data);
})
.success(function() { alert("second success"); })
.error(function() { alert("error"); })
.complete(function() { alert("complete"); });
// Do something here
// Set another completion function for the request above
jqXHR.complete(function(){ alert("second complete"); });