这种想法都有,完全失效不太可能,但也可以折中一下。试试下面这个。
<button onclick="go()">test</button>
<script>
function go(){
location.replace("www.csdn.net");
}
</script>
<button onclick="go()">test</button>
<script>
function go(){
location.replace("www.csdn.net");
}
</script>
在你的每个html或jsp页面前面引用这句话:
<script language="javascript">
if(history!=null){
history.go(1);
}
</script> 我测试过,无法回到前一页。
可能用:if(history!=null && history.length > 0 ){
history.go(1);
}
更准确一些。