我真的没有得到这个chrome错误:
未捕获的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="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>
任何帮助,不胜感激!
添加:
<script>
$(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。
对我来说,解决方案是我必须运行Web服务器。这是新的Chrome安全功能,根据Chromium Bug Post不会更改。
感谢A. Wolff!
使用本地HTML文件时,Turbolinks(HTML pushState)也可能导致这种情况。
本文地址:http://jquery.askforanswer.com/weibuhuodesecurityerrorwufazai-historyshangzhixing-replacestatewufazaiyuanwei.html
文章标签:google-chrome , javascript , jquery , jquery-mobile
版权声明:本文为原创文章,版权归 admin 所有,欢迎分享本文,转载请保留出处!
文章标签:google-chrome , javascript , jquery , jquery-mobile
版权声明:本文为原创文章,版权归 admin 所有,欢迎分享本文,转载请保留出处!
评论已关闭!