阻止跨源请求: 同源策略禁止在http://api.fixer.io/latest读取远程资源。 (原因:CORS标题' Access-Control-Allow-Origin'不匹配' http://winc-mypc')。 任何人都可以帮助解决这个问题
答案 0 :(得分:1)
这取决于您正在寻找什么样的解决方案!如果您只是需要在Chrome中停用此功能以进行开发,则可以使用--disable-web-security
标记启动Chrome:
chromium-browser --disable-web-security
答案 1 :(得分:1)
最后我使用jquery获得了解决方案,
$.ajax({
type: "POST",
url: 'http://api.fixer.io/latest',
async:true,
dataType : 'jsonp', //you may use jsonp for cross origin request
crossDomain:true,
success: function(data, status, xhr) {
alert(data)
}
});