【发布时间】:2012-01-17 08:14:20
【问题描述】:
我在玩 Quora 的 API。
我找到了这个 github 存储库,用于 quora 浏览器扩展 [https://github.com/drusepth/Quora-Chrome-Extension/blob/master/stable/background.html],它看起来就像执行 GET 一样简单http://api.quora.com/api/logged_in_user?fields=notifs,inbox。这应该会返回相关的 JSON。
但是当我从本地网页尝试相同的代码时,我得到了这个:
Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
为什么会这样?我该如何解决?
【问题讨论】:
标签: javascript jquery api cross-domain