JS跳转大概有以下几种方式:
第一种:(跳转到b.html)
<script language="javascript" type="text/javascript">
window.location.href="b.html"
</script>
第二种:(返回上一页面)
<script language="javascript">
window.history.back(-1)
</script>
第三种:
<script language="javascript">
window.navigate("b.html")
</script>
第四种:
<script language="JavaScript">
self.location=’b.html’
</script>
第五种:
<script language="javascript">
top.location=’b.html’
</script>
希望能棒到你。
平常页面跳转可以使用在html中写a标签及跳转地址实现
这种方式的好处在于直观、方便,但是缺点在于页面会出现刷新的情况,可以使用禁用浏览器的默认事件来防止。
也可以使用js控制页面跳转
在html中 为某个标签添加点击事件
在js中 可以使用如下方法来跳转页面
操作如下:
php)"
function lod(){
setTimeout(",但是我想动态一点location,和倒计时一样lod()",想把body中的“2秒后跳转”换成动态的.href(a/
<,0然后跳转,2000)
}
<script>,
<>
页面2秒后跳转
现在可以跳转了,1,及想要的效果是
2script>,求助实现js两秒后跳转我用了body onload=",刚搞js