【发布时间】:2016-01-07 11:14:10
【问题描述】:
我在尝试使用 Ajax jquery 从 Web 服务获取信息时遇到问题。我当前的代码:
$(document).ready(function () {
CallWebService();
});
function CallWebService() {
var URL = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml";
jQuery.ajax({
type: "POST",
url: URL,
dataType: "xml",
contentType: "application/xml; charset=utf-8",
success: function (data) {
console.log(data);
}
})
}
当我运行此代码时,我收到以下错误:
Mixed Content: The page at 'https://fiddle.jshell.net/_display/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'. This request has been blocked; the content must be served over HTTPS.
知道如何让它发挥作用吗?
【问题讨论】:
标签: jquery ajax xml web-services