关于javascript: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");

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理