熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

JS定時關閉窗口的實例

2022-06-13   來源: JSP教程 

  代碼如下:


<html xmlns="
<head runat="server">
<title></title>
<style type ="text/css" >
main{ backgroundcolor:Silver; width :px; height :px; marginleft:%; margintop :px; textalign :center;}
</style>
<script src="js/ui/jqueryminjs" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var n = ;
function showTime() {
n;
$(#divMain)html(n + 秒後關閉窗口);
if (n == )
windowclose();
else
setTimeout(showTime() );
}
</script>
</head>
<body onload ="showTime()">
<form id="form" runat="server">
<div id ="divMain" class ="main" >

</div>
</form>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20383.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.