禁止浏览器后退:在$(function() {})加入下面代码
<script>
history.pushState(null,null,document.URL);
window.addEventListener('popstate',function(){
history.pushState(null,null,document.URL);
});
</script>
在js中,加入下面代码,解决苹果微信浏览器后退时,页面不刷新问题:
window.onpageshow = function(event){
if (event.persisted) {
window.location.reload();
}
};