JS1.5秒后弹出对话框,并关闭网页

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var m_Message = "1";

function CheckMsg()
{
 setTimeout(CloseWindow, 1500);
}

//保存成功后,关闭窗口
function CloseWindow()
{
 if (m_Message == "1")
 {
  alert("保存数据成功!");
  window.returnValue = "true";
  window.close();
 }
 else
 {
  alert(m_Message);
 document.getElementById("cmd_Confirm").disabled = false;
 }
}
</script>
</head>
<body>
<input class="btn3_mouseup" id="cmd_Confirm" onclick="CheckMsg()" type="button" value="确定">
</body>
</html>

posted @ 2010-07-05 10:11  荣辱不惊  阅读(667)  评论(0编辑  收藏  举报