input onclick事件实现页面跳转


1.如果让本页转向新的页面则用:

<input type=button onclick=”window.location.href(‘连接’)“>

2.如果需要打开一个新的页面进行转向,则用:

<input type=button onclick=”window.open(‘连接’)“>

<input type=button value=刷新 onclick=”window.location.reload()“>

<input type=button value=前进 onclick=”window.history.go(1)“>

<input type=button value=刷新 onclick=”window.history.go(0)“>

<input type=button value=后退 onclick=”window.history.go(-1)“>

<input type=button value=前进 onclick=”window.history.forward()“>

<input type=button value=后退 onclick=”window.history.back()“>

后退+刷新

<input type=button value=后退 onclick=”window.history.go(-1);window.location.reload()“>

3.打开无边框的新窗口
<input type=”button” name=”Submit2″ value=”确 定” onclick=”javascript:(”,”,’width=720,height=500,resizable=yes,scrollbars=yes,status=no’)” />

4.点击按钮弹出确认alert窗口
方式一:
<input type=”button” name=”Submit1″ value=”确定”
onClick=”alert(‘是否确认提交?’);= ”;return false;” >
方式二:
<input type=”button” name=”Submit2″ value=”确定”
onClick=”if (confirm(‘是否确认提交?’))= ”;return false;” >


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM