1. 程式人生 > >網站賬號登出點選瀏覽器後退無法檢視原使用者資訊

網站賬號登出點選瀏覽器後退無法檢視原使用者資訊

<script type="text/javascript" src="jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" >
$(function() {
	if (window.history && window.history.pushState) {
		$(window).on('popstate', function() {
			window.history.pushState('forward', null, '#');
			window.history.forward(1);
		});
	}
	window.history.pushState('forward', null, '#'); //在IE中必須得有這兩行
	window.history.forward(1);
});
</script>