• 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

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

  • 相关阅读:
    webpack查缺补漏
    使用express、react、webpack打包、socket.io、mongodb、ant.design、less、es6实现聊天室
    理解restful 架构 && RESTful API设计指南
    socket.io
    数学图形(1.7)圆内旋轮线
    数学图形(1.6)抛物线
    数学图形(1.5)克莱线
    数学图形(1.4)心形线
    数学图形(1.3)旋轮线
    数学图形(1.2)Sin曲线
  • 原文地址:https://www.cnblogs.com/djlxs/p/5037461.html
Copyright © 2020-2023  润新知