Uncaught SecurityError:无法在'History'上执行'replaceState':无法在源文件'null'中创建 [英] Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null'

查看:134
本文介绍了Uncaught SecurityError:无法在'History'上执行'replaceState':无法在源文件'null'中创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的没有得到这个chrome错误:
$ b


未捕获的SecurityError:未能在'History'上执行'replaceState':不能在源文件中创建'null'

在Edge,Firefox和IE中没有错误。

我使用jquery 1.11.1和jquery mobile 1.4.5。

这是我的索引文件:

 <!DOCTYPE html> 
< html>
< head>

< meta charset =UTF-8>
< meta name =viewportcontent =width = device-width,initial-scale = 1>

< link rel =stylesheethref =css / xy.min.css/>
< link rel =stylesheethref =css / jquery.mobile.icons.min.css/>
< link rel =stylesheethref =css / jquery.mobile.structure-1.4.5.min.css/>

< title>< / title>

< / head>

< body>
< div data-role =page>
< div data-role =headerdata-add-back-btn =true>
< p align =center>测试< / p>
< / div>

    < li>< a href =assets / beck / index.htmldata-reldialog =external>Bäckereien< / a>< / li>
    < / ul>

    < / div>
    < script src =js / jquery-1.11.1.min.js>< / script>
    < script src =js / jquery.mobile-1.4.5.min.js>< / script>
    < / body>

    < / html>

非常感谢任何帮助!

解决方案

添加此项:

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

就在jquery.mobile-1.4.5.min.js之前



适用于Windows上的Android WebViewClient和Chrome。


I really don't get this chrome error:

Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null'

In Edge, Firefox and IE no errors.

I use jquery 1.11.1 and jquery mobile 1.4.5.

This is my index file:

<!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="css/xy.min.css" />
    <link rel="stylesheet" href="css/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="css/jquery.mobile.structure-1.4.5.min.css" />

    <title></title>

</head>

<body>
    <div data-role="page">
       <div data-role="header" data-add-back-btn="true">
           <p align="center">Test</p>
       </div>

        <ul data-role="listview" data-filter="true" data-filter-placeholder="Kategorie suchen"  data-inset="true" data-count-theme="b">
            <li><a href="assets/beck/index.html" data-rel"dialog" rel ="external">Bäckereien </a></li>
        </ul>

    </div>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/jquery.mobile-1.4.5.min.js"></script>
</body>

</html>

Any help much appreciated!

解决方案

Add this:

<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.

这篇关于Uncaught SecurityError:无法在'History'上执行'replaceState':无法在源文件'null'中创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆