<html>
<style>
</style>
<script>
var time = 31;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
timer();
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1></form>
</body>
</html>
<style>
</style>
<script>
var time = 31;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
timer();
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1></form>
</body>
</html>
解决方案 »
- javascript读取本地文件
- javascript不能控制flash播放
- 请求geoserver的WFS服务
- 灵活的显示div层:根据当前位置onmouseover时向上、向下或向左向右显示
- 关于window.open的刷新问题
- 网页框架后退
- ~~~~~~~~~Jquery回车TAB顺序,马上给分~~~~~~~~~~~
- 为什么是乱码?急!!!
- 求:将String转化为SELECT的javascript函数(string="aaa;bbb;ccc;ddd;")
- 当媒体播放机放完一段MPEG后,会发送消息吗(表明已放完的消息)?如果有,是什么消息?
- 如何用脚本判断DropDownList的哪一项被选中
- 求一正则表达式取得特定内容
<SCRIPT LANGUAGE="JavaScript">
<!--
var time = 60;
function foo()
{
time -= 1;
if (time == 0)
{
document.getElementById("tt").value = "OVER";
alert("close");
window.close();
}
else
{
document.getElementById("tt").value = "Time left: " + time;
setTimeout(foo, 1000);
}
}
foo();
//-->
</SCRIPT>like this.
<script>
o = document.getElementById("b");
start = 10;
setInterval("o.value=start--",1000);
</script>
<style>
</style>
<script>
var time = 30;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1>
<input type=button value="关闭" onclick="setTimeout('timer()', 1000);">
</form>
</body>
</html>
var nduration = 900
function dojishi(){
nduration --;
if(nduration ==0)
{window.opener=null;window.close();}
else
{
document.all.item('dd').value = nduration;
}
}
window.setInterval("dojishi()",1000)
</script>
<body>
你还有<input id='dd' type=text>秒关闭
</body>