【问题标题】:Quora Simple API & Cross Domain Origin Error?Quora 简单 API 和跨域源错误?
【发布时间】: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


    【解决方案1】:

    您需要将 api.quora.com 域添加到 manifest.json 文件的权限部分。更多详情请看这里:http://monsur.hossa.in/2011/07/07/chrome-extensions-and-cross-domain-requests.html

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 2015-02-18
      • 2018-11-19
      • 2016-11-17
      • 2011-02-22
      • 1970-01-01
      • 2021-05-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多