我正在开发一个移动应用程序,我通过远程 API 获取我的数据,但我的 javascript 程序返回以下错误:
XMLHttpRequest cannot load http://na.lolesports.com/api/standings.json?tournamentId=225. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ... is therefore not allowed access.
最佳答案
您对此无能为力,必须更改 API 的 CORS 设置。事实上,他们特别不允许跨站点来源,因为他们不想让第三方访问他们的 API:
https://developer.riotgames.com/discussion/community-discussion/show/GokMZKKl
关于javascript - 如何让Access Control Header跨域访问远程API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31541676/