HTML通过内置js如何返回上一个页面
HTML通过内置js如何返回上一个页面
这里列举三个js返回上一页的方法
1.通过 window.history.back()方法返回:
例如:
<button onclick="window.history.back()">返回上一个页面</button>
2.通过 window.history.go(-1)返回:
例如:
<button onclick="window.history.go(-1)">返回上一个页面</button>
3.通过 window.open("","","") 打开新窗口
(只需要在第一个参数那儿写上上一页的地址就可以啦):
例如:
<button onclick="window.open('www,baidu.com','新窗口','height=100, width=400')">返回上一个页面</button>