js 页面跳转两种方式(原页面跳转,打开新标签页)
文章目录
1 页面跳转(原页面跳转)
(1)a标签实现
<a href="https://segmentfault.com/u/webxejir">旭东怪的博客</a>(2)window.location.href实现
window.location.href="https://segmentfault.com/u/webxejir";2 页面跳转 (打开新标签页)
(1)a标签实现
<a href="https://segmentfault.com/u/webxejir" target="_blank">旭东怪的博客</a>(2)window.open()实现
window.open("https://segmentfault.com/u/webxejir");
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论