在 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/