阻止的跨来源请求:http://api.fixer.io/latest.
Cross-Origin Request Blocked:http://api.fixer.io/latest
阻止跨来源请求:同源策略不允许读取位于的远程资源http://api.fixer.io/latest.(原因:CORS标头"Access Control Allow Origin"不匹配http://winc-mypc’)。有人能帮助解决这个问题吗?
这取决于您正在寻找什么样的解决方案!如果您只需要出于开发目的在Chrome中禁用此功能,您可以使用--disable-web-security
标志启动Chrome:
chromium-browser --disable-web-security
最终我使用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)
}
});
相关文章:
- Pinterest API应用程序处于开发模式(因此我可以使用http重定向)
- 岗位http://localhost:3000/api/signup400(错误请求)
- postmates api的AJAX中的HTTP身份验证失败
- angularJS $http.get communicating with API
- 如何使用Chrome扩展API获取网页的所有HTTP请求
- 在 api 文档中 socket.io“Server(srv:http#Server, opts:Object)”是什么
- 如何使用在 Javascript 中对 API 进行 HTTP 调用
- $http.获取和$http.JSONP未能获得Google API响应
- HTTP API调用拒绝接受数据字段
- 如何添加api令牌作为我向api发出的每个HTTP请求的用户名
- 如何在带有JQuery的Neo4j 2.2.x中使用事务Cypher HTTP端点和新的REST API身份验证和授权
- 如何通过AngularJS$http从ASP.Net Web API 2获取访问令牌
- 如何获得$http API 调用的承诺
- 如何将包含对象而不是字符串的正文发布到 HTTP API?棱角2.
- Angular.JS $http API request
- 确保HTTP API的安全-无用户密码提示,避免暴露私钥
- 阻止的跨来源请求:http://api.fixer.io/latest.
- 无法通过HTTP API执行javascript命令
- 从Angular $HTTP API GET调用中解析日期
- 从HTTPS页面使用HTTP API