1、js跳转链接
在当前页面跳转:可以是绝对路径(像下面的),也可以是相对路径
window.location.href="https://www.baidu.com/";
浏览器新开页面跳转:可以是绝对路径(像下面的),也可以是相对路径
window.open('https://www.baidu.com/')
2、获取当前域名
console.log(window.location.host)
3、获取当前URL
console.log(window.location.href)