javascript - Angular.js 应用程序代码无法在 chrome 上运行 - 错误 "Failed to execute ' ReplaceState'

标签 javascript angularjs google-chrome

在 Angular.js 中制作了一个简单的库存应用程序。在 Firefox、Opera、IE 中一切正常,但在 Chrome 中则不然。

Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///C:/Users/Digital%20Jalebi%20-%20uno/Desktop/ANGULAR/index.html#/' cannot be created in a document with origin 'null'.

Issue at angular.js:9199

 if (logFn.apply) {
    return function() {
      var args = [];
      forEach(arguments, function(arg) {
        args.push(formatError(arg));
      });
      return logFn./*error*/apply(console, args);/*here*/
    };
  }

在 Stack Overflow 上阅读某处:

Some browsers like Chrome do not allow cross-origin on file://

Make sure you are running the application from a local server(like Wamp)

Then it will work

尝试过 WAmp - 没有成功。让我知道如何调试它。

最佳答案

尝试在本地服务器上运行应用程序。

关于javascript - Angular.js 应用程序代码无法在 chrome 上运行 - 错误 "Failed to execute ' ReplaceState',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32448536/

相关文章:

javascript - 如何阻止切换更改侧导航栏的宽度?

javascript - PHP 未从 Ajax 帖子接收 JSON

javascript - Angular 表单提交两次

AngularJS:两个具有单独 ngModel 的输入,一个更新另一个的值

ios - 固定定位元素在页面卸载时消失

javascript - Async/Await 与 JQuery 文档 READY

javascript - 如何在javascript中禁用标签标签

javascript - AngularJS 通过页面加载维护服务状态

css - google 网络字体在 firefox 和 chrome 中看起来不同

Python Selenium 设置多个 Chrome 首选项