问答详情
源自:3-1 jQuery Mobile 页面(一)

为什么会报错?

Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///D:/%E6%90%9C%E7%8B%90%E5%AD%A6%E4%B9%A0/%E8%87%AA%E5%B7%B1%E4%BD%9C%E4%B8%9A/wepabb/test/myapp.html' cannot be created in a document with origin 'null'.

提问者:东风破 2016-01-17 13:30

个回答

  • 夏一同学
    2016-08-03 14:00:21

    给你解析了一下,看一下

    Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///D:/搜狐学习/自己作业/wepabb/test/myapp.html' cannot be created in a document with origin 'null'.

  • kangkai_fe
    2016-04-22 22:55:00

    在引入jqm前加这么一段

    <script>

        $(document).bind('mobileinit',function(){

            $.mobile.changePage.defaults.changeHash = false;

            $.mobile.hashListeningEnabled = false;

            $.mobile.pushStateEnabled = false;

        });

    </script>


  • 夏一同学
    2016-01-17 14:36:03

    你先把路径换成非中文的,然后再尝试一下