如何实现这样的效果? 设置一个cookie用作计时,判断时间差 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 同意ttyp(愿赌服输)的方法,不过我认为使用SESSION变量是否更好?给个大概的思路,楼主可以参考一下:1.先判断是否有新消息2.如果有,则创建一个SESSION变量,并将当前时间放入此变量,然后用当前时间与此变量中的值进行比较,如果超过了某一个值,(比如半小时==),则播放某一个声音文件3.设置此网页的自动刷新时间为上面比较的值,比如上面设置为半小时,则这里也设置为半小时。 ---------test1.html---------------------------------------------<html><body><iframe id=aaa src="test2.html" refreshTimes=0 ></iframe><br>请注意iframe里有一个refreshTimes的属性。</body></html>---------test2.html---------------------------------------------<html><head><meta http-equiv="Refresh" content="2"><meta content="text/html;charset=gb2312" http-equiv="Content-Type"><script language=javascript>if(true)//有新信息{ if(window.top.document.all.aaa.refreshTimes%10==0)//如果在十次刷新之内己有过alert,则此if为false; { alert("有新信息。"); window.top.document.all.aaa.refreshTimes=window.top.document.all.aaa.refreshTimes*1+1; } else window.top.document.all.aaa.refreshTimes=0;}</script></head><body>自动刷新页面。存在于id为aaa的iframe中</body></html> iphone4 WEB应用中文本框无法自动得到输入焦点 如何使用js实现rar压缩文件时“后台”执行? js两个小数计算问题 正则表达式判断URL问题, 正则问题 关于单选框与按钮(急/急/急) 如何得到光标所在控件的控件ID。 javascript简单问题 用js控制网页链接的css文件的问题 为什么我的Excel大不开,急!!!!!!!!!!!!,只有10分了 如何在javascript实现VBS中LenB("abc一二三")等于12这样的功能 数据格式问题(如:1234.536 --> 1,234.54),在线等待
<html>
<body>
<iframe id=aaa src="test2.html" refreshTimes=0 ></iframe><br>
请注意iframe里有一个refreshTimes的属性。
</body>
</html>---------test2.html---------------------------------------------
<html>
<head>
<meta http-equiv="Refresh" content="2">
<meta content="text/html;charset=gb2312" http-equiv="Content-Type">
<script language=javascript>
if(true)//有新信息
{
if(window.top.document.all.aaa.refreshTimes%10==0)//如果在十次刷新之内己有过alert,则此if为false;
{
alert("有新信息。");
window.top.document.all.aaa.refreshTimes=window.top.document.all.aaa.refreshTimes*1+1;
}
else
window.top.document.all.aaa.refreshTimes=0;
}
</script>
</head>
<body>自动刷新页面。存在于id为aaa的iframe中</body>
</html>