AJAX怎么每隔1分钟刷新一次页面
我现在想做一个自动的弹出窗体,每隔1分钟提醒目前用户的一些信息以及一些提示语。想在页面里面隐藏一个iframe通过AJAX来刷新页面来进行,刷新的时候要扫描数据库里面的消息表是否存在该用户的消息,如果有就弹出,如果没有就不弹出,请问通过AJAX和C#要如何去实现,最好能附上代码,因为以前很少接触到AJAX --------------------编程问答-------------------- --------------------编程问答-------------------- 可以通过弹出层来做。。。。timer --------------------编程问答-------------------- timer --------------------编程问答-------------------- 在一个不会变的iframe上,一般就是个topFrame上iID=setInterval(FunctionName, 600000);之后定时调用一个js咯。 --------------------编程问答-------------------- 帮顶 --------------------编程问答-------------------- http://topic.csdn.net/u/20091223/13/7F94CCAA-A6C3-479A-8DA5-537634085A13.html --------------------编程问答-------------------- --------------------编程问答-------------------- 设置一下timer的时间 --------------------编程问答-------------------- 定时 timer 每隔1秒执行一次就OK了 --------------------编程问答-------------------- 没必要用:iframe
ajax就可以完全实现了
http://www.ibm.com/developerworks/cn/xml/x-ajaxjquery.html --------------------编程问答-------------------- setTimeOut(function,1000*60); --------------------编程问答-------------------- timer貌似可以实现。具体的我也不太清楚,学习了、 --------------------编程问答--------------------
页面上怎么用timer,winform倒是可以 --------------------编程问答--------------------
写个setInterval("方法名()",1000);
方法中用AJAX传入相应参数到一般处理程序,请求相应数据 --------------------编程问答--------------------
function StateChange() {
if (xhr.readyState == 4 && xhr.status == 200) {
percentage = xhr.responseText;
var progBar = document.getElementById("progressBar");
progBar.style.width = percentage + '%';
progBar.style.background = "#5ea7e3";
if (percentage == 100) {
alert("完成");
}
else {
setTimeout("UpdateProgress()", 200);
}
}
}
重点是setTimeout("UpdateProgress()", 200);我这设的是两秒,你可以根据设为一分钟,希望对你有用 --------------------编程问答-------------------- --------------------编程问答-------------------- js就可以了 --------------------编程问答-------------------- js在客户端刷岂不更快 --------------------编程问答--------------------
--------------------编程问答-------------------- setTimeout() --------------------编程问答-------------------- 顶一个!! JF --------------------编程问答-------------------- 设置Timer间隔为1分钟 --------------------编程问答-------------------- timer完美解决~ --------------------编程问答-------------------- 弄个timer 放updatepanel里 在Timer_Tick事件里写你要的东西 --------------------编程问答-------------------- timer控件 --------------------编程问答-------------------- 使用ajax的Timer控件,设置时间每过一分钟刷新一下 --------------------编程问答-------------------- timer,每隔一分钟触发一次事件。。。 --------------------编程问答-------------------- 一定是time处理了,例子很多了,jquery提示弹出层,楼主可以找下
<script>
function openWindow(win,winTitle,winWidth,winHeight)
{
var winleft=window.screen.width-winWidth-12;
var winTop=window.screen.height-winHeight-75;
window.open(win ,winTitle,'width='+ winWidth +'px,height='+ winHeight +'px,left='+ winleft +'px,top='+ winTop +'px,scrollbars=1,status=0');
}
</script>
<script language="javascript" type="text/javascript" src="../js/Ajax.js"> </script>
<script language="javascript" type="text/javascript">
function check(typeStr)
{
var myurl="Tip.aspx?type="+typeStr;
var MyWebSend="";
xmlHttp.open("POST",myurl,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = ValidateCallBack;
xmlHttp.send(MyWebSend);
}
function checkNormal()
{
check('normal');
window.setTimeout("checkNormal()",60000);
}
function checkCalendar()
{
check('calendar');
window.setTimeout("checkCalendar()",1200000);
}
//处理返回结果的函数
function ValidateCallBack()
{
if (xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
var result=xmlHttp.responseText;
if(result.indexOf("Exist::")==0)
{
openWindow('popTip.aspx','smsWindows','430','220');
}
}
else
{
}
}
}
</script>
</head>
<body onload="checkNormal();checkCalendar();">
在popTop里绑定数据
<script>
focus();
TimeStart=30;
function MyTimer()
{
if(TimeStart==0)
window.close();
if(document.getElementById("TimeShow"))
document.getElementById("TimeShow").innerHTML=TimeStart;
TimeStart--;
var timer=setTimeout("MyTimer()",1000);
}
补充:.NET技术 , ASP.NET