【问题标题】:Can I embed CORS anywhere code into my javascript/jquery?我可以将 CORS 代码嵌入到我的 javascript/jquery 中吗?
【发布时间】:2019-02-15 10:02:23
【问题描述】:

我可以将 CORS 代码嵌入到我的客户端 javascript/jquery 代码中,而不是使用“https://cors-anywhere.herokuapp.com/”和我的 URL。因为很多时候它给出了应用程序错误,我无法访问我的 URL。如果我在任何地方都有 CORS 的本地副本会很方便。 任何帮助表示赞赏。

【问题讨论】:

    标签: javascript jquery cors client cors-anywhere


    【解决方案1】:

    您可以在本地开发机器上安装反向代理脚本。见https://github.com/Rob--W/cors-anywhere/ 您将需要 NodeJS 在您的机器上运行。 或者,如果您处于开发阶段并且需要绕过 CORS,您可以使用以下命令行在 Windows 上启动您的 chrome 浏览器:

    start .\chrome.exe --disable-web-security --user-data-dir="D:/Chrome"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 1970-01-01
      相关资源
      最近更新 更多