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>