js跳转

1、连接到某页

<input type="button" name="Submit" value="确 定" class="btn" οnclick="location.href='filename.html'" /> 

 

2、返回(等同后退)

<input name="Submit2" type="button" class="btn" οnclick="location.href='javascript:history.go(-1);'" value="返 回" /> 

 

3、打开新网页

<input type="button" name="Submit2" value="确 定" class="btn" οnclick="window.open('filename.html')" /> 

 

4、打开无边框的新窗口

<input type="button" name="Submit2" value="确 定" class="btn" οnclick="javascript:window.open('filename.html','','width=720,height=500,resizable=yes,scrollbars=yes,status=no')" /> 

 

 5、打开新网页的同时指向另一页

<input type="button" name="Submit2" value="确 定" class="btn" οnclick="window.open('filename.html');location.href='http://hi.baidu.com/harryxue'" />

 

 6、打开无边框的新窗口同时指向另一页

<input type="button" name="Submit2" value="确 定" class="btn" οnclick="javascript:window.open('http://hi.baidu.com/harryxue','','width=720,height=500,resizable=yes,scrollbars=yes,status=no'); window.location='filename.html';" />

 

 7、点击按钮弹出确认alert窗口

方式一: 
<input type="button" name="Submit1" value="确定" class="btn" 
onClick="alert('是否确认提交?');location.href= 'filename.html';return false;" > 

方式二: 
<input type="button" name="Submit2" value="确定" class="btn" 
onClick="if (confirm('是否确认提交?'))location.href= 'filename.html';return false;" >

 

===========================

<input   type=button   value=刷新   οnclick="window.location.reload()">
  <input   type=button   value=前进   οnclick="window.history.go(1)">
  <input   type=button   value=后退   οnclick="window.history.go(-1)">
  <input   type=button   value=前进   οnclick="window.history.forward()">
  <input   type=button   value=后退   οnclick="window.history.back()">

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值