事件触发后的页面转向问题(原页面,新页面,刷新,前进,后退)
2012-07-26 08:50
204 查看
input Button 按钮,跳转链接,方法:
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;” >
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;” >
相关文章推荐
- 处理Flex 页面的后退前进刷新关闭事件
- 要在当前页面刷新,触发点击事件才可以显示效果的问题
- pushState()、popstate事件配合ajax实现浏览器前进后退页面局部刷新
- 处理Flex 页面的后退/前进/刷新/关闭事件
- 基于Jquery 解决Ajax请求的页面 浏览器后退前进功能,页面刷新功能实效问题
- 处理Flex页面的后退、前进、刷新、关闭事件
- ASP.NET GridView 后台绑定行点击行触发SelectedIndexChanged,页面刷新后,只有一页的情况下,事件只触发一次
- 【JS】:JS实现页面的刷新,后退和前进
- 键盘回车事件导致页面刷新的问题
- 工作问题总结(二十九)模拟按键(刷新,前进,后退,主页)
- 键盘回车事件导致页面刷新的问题
- AJAX的后退页面刷新问题的解决方法(1)
- 键盘回车事件导致页面刷新的问题
- 键盘回车事件导致页面刷新的问题
- pushState、replaceState、onpopstate 实现Ajax页面的前进后退刷新
- 键盘回车事件导致页面刷新的问题
- Android WebView的前进、后退、与刷新以及OnkeyDown事件 和 OnBackPressed方法注意点
- html5新特性:利用history的pushState等方法来解决使用ajax导致页面后退和前进的问题
- html5新特性:利用history的pushState等方法来解决使用ajax导致页面后退和前进的问题