【问题标题】:Uncaught SecurityError: Failed to execute 'replacestate'未捕获的安全错误:无法执行“replacestate”
【发布时间】:2015-10-02 06:05:28
【问题描述】:

我不知道如何解决此错误,每次我在 Google Chrome 上测试我的应用程序时都会出现此错误,但该应用程序在 Firefox 中运行良好。我应该怎么做才能解决这个问题?

未捕获的安全错误:无法在“历史”上执行“replaceState”:无法在文档中创建 URL 为“file:///C:/Users/User/Desktop/finalproject/index.html”的历史状态对象原点为“空”。

【问题讨论】:

  • 这是 chrome 的安全功能(同源限制):Origin null is not allowed by Access-Control-Allow-Origin 问题与replacestate 无关,但根本问题是相同的
  • 我应该怎么做才能解决这个问题?
  • 一个月前它在 chrome 上运行良好,但现在即使是我新创建的应用程序也会产生相同的错误,并且只能在 firefox 上运行
  • 阅读链接的问题和建议的答案:)
  • 它现在可以工作了,非常感谢您的帮助:)

标签: javascript jquery-mobile


【解决方案1】:

这是 chrome 的一项安全功能(同源限制)。

这个问题与replacestate 无关,但根本问题是相同的:
Origin null is not allowed by Access-Control-Allow-Origin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-04
    • 2016-03-19
    • 2015-12-03
    • 1970-01-01
    • 2015-12-07
    • 1970-01-01
    • 2014-12-07
    • 2021-02-10
    相关资源
    最近更新 更多