62,025
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
function showImg()
{
document.getElementById("img1").src ="http://localhost/img.ashx";
}
setInterval("showImg()", 5000);
<img src="http://localhost/img.ashx" id="img1" />
private System.Timers.Timer pulseTimer;
protected void XXX
{
int interval = 1;//基数
interval = interval * 1000;//设置秒
pulseTimer = new System.Timers.Timer(interval);//每隔interval秒执行一次
pulseTimer.Elapsed += new System.Timers.ElapsedEventHandler(pulseTimer_Elapsed);
pulseTimer.Start();
}
//执行
private void pulseTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
}
function funX(){
....
setTimeout(function{
//要执行的函数,也就是ajax;
},5000);
}