TestCode

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

还是之前的一些小实验,贴出来晒晒,以后兴许会比较有印象

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
function Onload(){
alert(
"加载页面时进行");
}
function OnButtonClick(){
alert(
"你点击了按钮");
}
function Ondblclick(){
window.alert(
"你双击了页面");
if(window.confirm("问题?")){
alert(
"你点击了确定");
}
else{
alert(
"取消进入");
}
naviage(
"http://baidu.com");
}
var intervalId ;
function BeginInterval(){
intervalId
= window.setInterval("alert('定时器启动');",2000);
intervalId2
= window.setInterval("alert('定时器启动');",0000);
}
function StopInterval(){
window.alert(
"定时器将被清除。。");
clearInterval(intervalId);
clearInterval(intervalId2);
}
</script>
</head>
<body onload="Onload()" ondblclick="Ondblclick()" >
<form action="">
<input type="text" id="textbox1"/>
<input type="button" id="btn1"onclick="OnButtonClick()" value="点击我吧 。。。"/>
<input type="button" onclick="navigate('http://baidu.com');" value="点我跳转到其他页面"/>
<input type="button" id="stopInterval" value="停止计时器" onclick="StopInterval()"/>
<input type="button" id="beginInterval" value="开始计时器" onclick="BeginInterval()"/>
</form>
</body>
</html>
posted on 2011-06-25 16:42  yaoguipeng  阅读(179)  评论(0编辑  收藏  举报