<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!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 runat="server">
<title></title>
<script language="javascript" type="text/javascript">
//方法一直接调用代码在5s关闭窗体
setTimeout('window.close();', 5000);
//方法二调用自定义方法在5s关闭窗体
// setTimeout('formClose()', 5000);
// function formClose() {
// window.close();
// }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
javascript setTimeout实现定时关闭网页
最新推荐文章于 2022-01-18 17:01:50 发布