キャッチされないセキュリティエラー: 'History' で 'replaceState' を実行できませんでした: 元のドキュメントが 'null' の場合、作成できません 質問する

キャッチされないセキュリティエラー: 'History' で 'replaceState' を実行できませんでした: 元のドキュメントが 'null' の場合、作成できません 質問する

この Chrome エラーは実際には発生しません:

キャッチされないセキュリティ エラー: '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="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>

ご協力いただければ幸いです。

ベストアンサー1

これを追加:

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

jquery.mobile-1.4.5.min.jsの直前

これは、Android WebViewClient および Windows 上の Chrome で動作します。

おすすめ記事