4.13.2

<html>
<head>
<script type="text/javascript">
  function testalert(){
    window.alert("你好吗");
  }
  function testconfirm(){
    var mes=window.confirm("您确定退出吗");
  /*if(mes==true)*/
  if(mes){
  //关闭窗口
    window.close();
    }
  }
  function testprompt(){
    var name=window.prompt("请输入你的名字");
    //prompt返回值是字符串
    //在需要计算的时候需要转换成数值类型再计算
    alert(name);
  }

  function testscroll(){
    //window.scrollBy(50,50)
    window.scrollTo(150,200);
    }
  function testopen(){
  window.open("http://www.baidu.com","baidu",
  left=300,top=200,width=200,height=500);
    }
</script>
</head>

<body>
<input type="button" value="滚动" onClick="testscroll()">
<input type="button" value="打开新窗口" onClick="testopen()">
<div style="width: 2000px;height: 200px;background: red"></div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>

 

posted on 2019-04-13 11:52  boss-H  阅读(147)  评论(0)    收藏  举报

导航