Uncaught SecurityError: Failed to execute 'replaceState' on 'History'

Uncaught SecurityError: Failed to execute ‘replaceState‘ on ‘History‘: A history state object with URL ‘file:///C:/Users/Administrator/Desktop/%E5%BE%AE%E4%BF%A1/%E4%BA%91%E5%88%9B/index.html‘ cannot be created in a document with origin ‘null‘.

在引入jQuery mobeil 的js和css后,兴奋的在谷歌上进行测试时,却发现报了上诉错误。纳闷了,我都是按着步骤来的啊,并且没有错啊,怎么会这样啊!这是由于谷歌的新的安全机制

Chrome recently change their security in relation to local HTML files ability to access History.

下面是解决办法:

1. Switch to a different brand of web-browser.  (火狐等其他浏览器是可以的)
You can change back to Chrome once the developer of Snowman is able to release a new version with this fix, although that may take a while because that would require a new release of the Twine application.

2. Open an instance of Chrome with the --allow-file-access-from-files parameter.
WARNING: Doing this will partially change the security of Chrome, I suggest not using this instance of Chrome to access content on the internet.

前面两种方法的链接:http://twinery.org/forum/discussion/4747/uncaught-securityerror-failed-to-execute-replacestate-on-history

3

<script>
    $(document).bind(‘mobileinit‘,function(){
        $.mobile.changePage.defaults.changeHash = false;
        $.mobile.hashListeningEnabled = false;
        $.mobile.pushStateEnabled = false;
    });
</script>

Just before jquery.mobile-1.4.5.min.js

That works with Android WebViewClient and Chrome on Windows.

4 $.mobile.pushStateEnabled = false; in the script
链接:http://stackoverflow.com/questions/32453806/uncaught-securityerror-failed-to-execute-replacestate-on-history-cannot-be

一点点感悟:外国的一些网站确实有时很有用,我以前很怕英文网站,现在正在开始尝试慢慢去看。---只为更好的自己

Uncaught SecurityError: Failed to execute 'replaceState' on 'History'

时间: 2024-11-08 03:05:45

Uncaught SecurityError: Failed to execute 'replaceState' on 'History'的相关文章

android webview &quot;Uncaught SecurityError: Failed to read the &#39;localStorage&#39; property from &#39;Window&#39;: Access is denied for this document.&quot;, source: (1)

这种错误,可以在loadurl之后再调用 localstorage.setitem()即可解决. "Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.", source:  (1) android webview "Uncaught SecurityError: Failed to read t

Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goals:clean install tomcat7:run ,there is an error : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)

fetch 报错 Failed to execute &#39;fetch&#39; on &#39;Window&#39;: Request with GET/HEAD method cannot have body.

TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. 在"窗口"上执行"取"失败:GET / get方法的请求不能有正文. GET requests can't have a request body, you can't make them have one. GET requests only retrieve data,

STM32初学Keil4编译时出现 Error:Failed to execute &#39;BIN40/Armcc&#39;

一种是在系统开始--运行里输入cmd,查看armcc状态.详情见推文: http://blog.csdn.net/hicui/article/details/7350805(笔记记录,请勿见怪) 都没有问题的话,那么可以尝试: 在keil里的菜单栏依次选择Project->Manage->Components,Environment andBooks(CEB)(或者直接点击工具栏的图标), 然后在CEB里选择Folders/Extensions标签页,在RealView Folder里选择ke

Error: failed to execute &#39;C:\Keil\ARM\ARMCC&#39;的解决办法

引用自:http://blog.csdn.net/zwj695535100/article/details/45787333 在KEIL新建工程时,容易出现该问题,我查了一些资料,最终找到该问题解决方法: 第一步:在keil里的菜单栏依次选择Project->Manage->Components,Environment andBooks(CEB) 第二步:然后在Environment andBooks(CEB)里选择Folders/Extensions标签页, 第三步:在RealView Fo

maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang

maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang: Error assembling WAR: webxml attribute is required 原因:找不到web.xml,但是项目中明明有这个文件,在WebContent/WEB-INF/文件夹下,就是识别不了解决方法:需要在pom

解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project autotest_fchtgl: Compilation failure的方法

在碰到maven install 发现报错 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project autotest_fchtgl: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on

Maven错误“Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create ”解决

用maven3新建一个项目时,输入的命令如下: mvn archetype:create 出现错误如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apache.maven.plugins:mav

Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on project **

maven编译项目时报错:Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on project 原因: 没有安装rpm. 安装rpm build工具包: yum install rpm 或者 sudo apt-get install rpm 具体错误是: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm