常用到的Button链接
2014-03-27 14:55
162 查看
1.链接到某页
<input type="button" name="Submit" value="确 定" class="btn" onclick="location.href='filename.html'" />
2.返回(等同后退)
<input name="Submit2" type="button" class="btn" onclick="location.href='javascript:history.go(-1);'" value="返 回" />
3.打开新网页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="window.open('filename.html')" />
4.打开无边框的新窗口
<input type="button" name="Submit2" value="确 定" class="btn" onclick="javascript:window.open('filename.html','','width=720,height=500,resizable=yes,scrollbars=yes,status=no')" />
5.打开新网页同时指向另一页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="window.open('filename.html');location.href='http://hi.baidu.com/harryxue'" />
6.打开无边框的新窗口同时指向另一页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="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" name="Submit" value="确 定" class="btn" onclick="location.href='filename.html'" />
2.返回(等同后退)
<input name="Submit2" type="button" class="btn" onclick="location.href='javascript:history.go(-1);'" value="返 回" />
3.打开新网页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="window.open('filename.html')" />
4.打开无边框的新窗口
<input type="button" name="Submit2" value="确 定" class="btn" onclick="javascript:window.open('filename.html','','width=720,height=500,resizable=yes,scrollbars=yes,status=no')" />
5.打开新网页同时指向另一页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="window.open('filename.html');location.href='http://hi.baidu.com/harryxue'" />
6.打开无边框的新窗口同时指向另一页
<input type="button" name="Submit2" value="确 定" class="btn" onclick="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;" >
相关文章推荐
- 自己总结了一下常用到的Button链接,代码如下:
- button的常用链接
- 文本转载【Cocos2D-X 】初窥门径(16)几种常用的 CCMenuItem、自定义Button
- 常用链接
- 一个button 常用的宏定义
- Android开源特效常用链接大集合
- 产品设计常用链接和资源
- Button 常用事件
- JAVA常用数据库的链接方法
- MFC编程入门之二十二(常用控件:按钮控件Button、Radio Button和Check Box)
- Android常用UI组件 - Button
- 最常用的链接
- button/input链接方式全攻略
- 常用SQL和链接
- 常用IBM技术和产品资源链接
- 整理一些常用技术的博客链接,持续更新。
- 常用牛人主页链接(计算机视觉、模式识别、机器学习相关方向,陆续更新。。。。)
- 常用工具及插件下载, [复制链接]
- MySQL数据库与其他数据库的3个常用语法区别(外链接、分组排序row_number() over(partition by ) 、group by和distinct)
- ectouch第六讲 之表常用链接