我正在尝试从公共网络服务http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx?WSDL获取任何数据, 但它出了点问题。每次我收到“0 错误”失败警报消息。有人可以帮忙吗?
<!DOCTYPE html>
<html>
<head>
<script src="Scripts/jquery-1.8.3.min.js"></script>
</head>
<body>
<input type="button" id="hello" value="Get data."/>
<script>
$("#hello").click(function () {
$.support.cors = true;
$.ajax({
type: "POST",
url: "http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx/EnumValutes",
data: "{Seld : False}",
datatype: "xml",
success: function (msg)
{
Successfullcalling(msg);
},
error: Failurecalling
});
});
function Successfullcalling(res)
{
alert("Done!");
}
function Failurecalling(res)
{
alert(res.status + ' ' + res.statusText);
}
</script>
</body>
</html>