報錯:Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL'file:///E:/Mars/JQuery-Mobile-Slide-Menu-master/index.html' cannot be created in a document with origin 'null'.
問題原因:跨域。
解決方案:
1、先打開瀏覽器再打開項目頁面;
2、在引用“jquery.mobile.js“前添加如下代碼:
<script>
<span style="white-space:pre"> </span>$(document).bind('mobileinit',function(){
$.mobile.pushStateEnabled = false;
});
</script>
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>