JS实现页面跳转的方法

1.使用window.location.href

//跳转到index.html
<script language="javascript" type="text/javascript">
window.location.href="index.html";
</script>

2.使用window.history.go

//返回上一界面
<script language="javascript">
window.history.go(-1);
</script>

3.使用window.navigate

//只针对IE的,跳转到index.html
<script language="javascript">
window.navigate("index.html");
</script>

4.使用self.location

<script language="JavaScript">
self.location.href="index.html";//仅在本页面打开url地址
</script>

5.使用top.location

<script language="javascript">
top.location.href="index.html";//在顶层页面打开url
</script>

6.使用a标签实现跳转

<a href="http://www.google.com" target="_blank">Google</a>
全部评论

相关推荐

07-11 10:56
门头沟学院 Java
码客明:大胆的说自己能实习6个月就行
点赞 评论 收藏
分享
下北澤大天使:你是我见过最美的牛客女孩😍
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务