Uncaught SecurityError: Failed to execute 'replaceState' on 'History'
2015-12-10 21:57
549 查看
Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///C:/Users/Administrator/Desktop/%E5%BE%AE%E4%BF%A1/%E4%BA%91%E5%88%9B/index.html' cannot be created in a document with origin 'null'.
在引入jQuery mobeil 的js和css后,兴奋的在谷歌上进行测试时,却发现报了上诉错误。纳闷了,我都是按着步骤来的啊,并且没有错啊,怎么会这样啊!这是由于谷歌的新的安全机制Chrome recently change their security in relation to local HTML files ability to access History.
下面是解决办法:
1. Switch to a different brand of web-browser. (火狐等其他浏览器是可以的)
You can change back to Chrome once the developer of Snowman is able to release a new version with this fix, although that may take a while because that would require a new release of the Twine application.
2. Open an instance of Chrome with the --allow-file-access-from-files parameter.
WARNING: Doing this will partially change the security of Chrome, I suggest not using this instance of Chrome to access content on the internet.
前面两种方法的链接:http://twinery.org/forum/discussion/4747/uncaught-securityerror-failed-to-execute-replacestate-on-history
3
<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.
4
$.mobile.pushStateEnabled = false;in the script
链接:http://stackoverflow.com/questions/32453806/uncaught-securityerror-failed-to-execute-replacestate-on-history-cannot-be
一点点感悟:外国的一些网站确实有时很有用,我以前很怕英文网站,现在正在开始尝试慢慢去看。---只为更好的自己
相关文章推荐
- 证明静态函数在main函数运行前就运行了
- 使用Rails restful方式的Session实现登陆机制
- Codeforces Round #335 (Div. 2) C. Sorting Railway Cars 最长连续上升子序列
- Codeforces Round #335 (Div. 2) 605A Sorting Railway Cars
- Daily Scrum NO.3
- Daily Scrumming* 2015.12.10 今天集体请假一天
- 解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误
- zzulioj--1089--make pair(dfs+模拟)
- zzulioj--1089--make pair(dfs+模拟)
- The Longest Straight
- View工作原理(一)事件传递原理详解http://blog.csdn.net/ff20081528/article/details/17353869
- Codeforces Round #335 (Div. 2)-Sorting Railway Cars(求连续的上升序列的最大值)
- 走迷宫机器人程序之3--main
- 正在创造“情感计算”的微软小冰,或将开启未来计算新纪元
- 中国雾霾 China smog_ Sky dark from air pollution
- LightOJ 1071 - Baker Vai(水DP)
- Factorial Trailing Zeroes
- Setup MIPS cross compile toolchain
- Codeforces Round #335 (Div. 2) C. Sorting Railway Cars 动态规划
- Climbing Stairs