我试图回答与此标签相关的所有问题,但我没有成功我的错误在哪里?
$(document).ready(function () {
$.ajax({
type: "GET",
url: "http://www.tcmb.gov.tr/kurlar/today.xml",
dataType: "xml",
headers: {
'Access-Control-Allow-Origin ': '*'
},
success: function (xml) {
alert("Success");
}
});
});
我的错误;
Access to XMLHttpRequest at 'http://www.tcmb.gov.tr/kurlar/today.xml' from origin 'http://localhost:44318' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我在 asp.net 框架中使用 jquery ajax。请我尝试了所有问题的答案,请不要抛出问题标题。