关闭模式窗口

 <script language="javascript">
function show(){
var sRet = window.showModalDialog('a.html','title','scrollbars=no;resizable=no;help=no;status=no;dialogTop=25; dialogLeft=0;dialogHeight=350px;dialogwidth=410px;');
  if(sRet == "refresh")
  {
   window.location.reload();
  }
  
}
</script>
<input name="" type="button" onClick="show();" value="打开" />

a.html
<script language="javascript">
function al(){
  alert("关闭了哦");
  window.returnValue = "refresh";
  window.close();
}
</script>
<input name="" type="button" onClick="al();" value="关闭" />

你可能感兴趣的:(JavaScript,function,input,button)