<SCRIPT LANGUAGE=javascript>
<!--
var closeTime=new Date(2002,2,30,2,30)
document.write("<title>",closeTime,"</title>")
closeWin()
function closeWin()
{
MM=new Date()
if(MM>=closeTime)
{
window.close()
}
else{
setTimeout("closeWin()",1000)
}
}
//-->
</SCRIPT>
<!--
var closeTime=new Date(2002,2,30,2,30)
document.write("<title>",closeTime,"</title>")
closeWin()
function closeWin()
{
MM=new Date()
if(MM>=closeTime)
{
window.close()
}
else{
setTimeout("closeWin()",1000)
}
}
//-->
</SCRIPT>
解决方案 »
- textarea 与 execCommand
- javascript 我想实现的效果是填写固话小灵通后就不能填写手机,否则倒过来.
- ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●哪些对象有item属性啊????这句话啥意思啊????
- (散分)一个循环用法的问题,那一个会更好呢
- 在线测试网速是怎么实现的
- Javascript可以读写文件吗
- 在ASP+vbscript/javascript中,如何实现数据表格的图表化,就像股票的走势图,或者直方图等等,请赐教!!
- 150分求解!如何在客户端对文件进行操作?
- 那里有chm格式的JavaScript和DHTML帮助下载
- 『难题, 求解』IE通过域名访问网站,JS运行出现问题, 有IP直接访问是可以正常显示的
- 关于table的一些问题
- 关于cookie的小问题
<head>
<title>Hello World</title>
<body>
<input type="button" value="close window" onclick="closeWin()">
</body>
<script language="javascript">
var nSecond = 10;
var dtStart = null;
function closeWin()
{
var ns = nSecond;
if (!dtStart)
dtStart = new Date();
else
{
var dt = new Date();
var sp = Math.floor((dt.getTime()-dtStart.getTime())/1000);
if (sp >= nSecond)
{
window.opener = null
window.close();
return;
}
ns= nSecond - sp;
}
document.title = "Closing in " + ns + " seconds";
setTimeout("closeWin()",1000);
}
</script>
</html>
var n=10;
function clock(){
if(--n==0){window.opener=null;window.close();}
document.title="还有"+n+"秒关闭"
setTimeout(clock,1000);
}
clock();
</script>