我有这个问题......我正在开发一个从 JSON 文件加载名称的项目(这并不重要)。
问题是我使用 Wikia Special:Filepath链接来获取我的图像。因此,当我在浏览器中输入:http: //2007.runescape.wikia.com/wiki/Special:Filepath/ Abyssal_head.png它会返回此图片链接:http: //img1.wikia.nocookie.net/__cb20140108135954/2007scape /images/0/0f/Abyssal_head.png。
有没有办法解决这个重定向,以便我可以通过 ajax 调用正确加载它?每当我尝试执行第一个链接时,我都会收到此错误(这是正常的,因为它找不到我认为的正确标题):
XMLHttpRequest cannot load http://2007.runescape.wikia.com/wiki/Special:Filepath/Abyssal_head.png. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
欢迎所有帮助。