TestCode

博客园 首页 新随笔 联系 订阅 管理

这个也是之前做过的小测试,晒晒,温故知新。

主要还是页面跳转的功能,还有一些比较好用的方法

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
alert(
"加载。。");
alert(
"显示器分辨率:"+window.screen.width+"*"+window.screen.height);

</script>
</head>
<body >
<input type="button" value="href" id="href" onclick="location.href='http://baidu.com'"/>
<input type= "button" value= "navigate" id="navigate" onclick="navigate('http://baidu.com')"/>
<input type="button" value="刷新页面" id="refresh" onclick="window.location.reload()"/>
<a href="http://baidu.com" onclick="window.event.returnValue=false ">点击前往百度</a>
<form action="HTMLPage.htm">
<input type="submit" value="提交" onclick="alert('数据有错,禁止提交');window.event.returnValue=false"/>
</form>

<input type="button" value="分享给好友" id="share" onclick="window.clipboardData.setData('Text',window.location.href);alert('复制成功');"/>
</body>
</html>
posted on 2011-06-25 17:11  yaoguipeng  阅读(173)  评论(0编辑  收藏  举报