js 跳转指定页面

 1 window.open('https://www.baidu.com/','top');
 2 #在当前页面打开baidu地址 和 <a href='https://www.baidu.com/'></a> 效果相同
 3 
 4 
 5 window.location.href = 'https://www.baidu.com/';
 6 #在新窗口打开baidu地址 和 <a href='https://www.baidu.com/' target='_blank'></a> 效果相同
 7 
 8 
 9 window.history.back(-1);
10 #返回到操作前一个页面

参考:

https://www.cnblogs.com/lijshui/p/7451360.html

原文地址:https://www.cnblogs.com/whycai/p/12506235.html