52,787
社区成员
发帖
与我相关
我的任务
分享 function myrefresh() {
$.post("../refresh.aspx", { 'action': 'refresh' }, function(data) {
if (data > 0) {
$("#sp_talk").removeClass('icon70-tel');
$("#sp_talk").addClass('icon70-telcall');//有消息改变样式
} else {
$("#sp_talk").removeClass('icon70-telcall');
$("#sp_talk").addClass('icon70-tel');
}
});
}
setInterval('myrefresh()', 5000); //指定时间刷新一次 public string action;
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Request["action"])) action = Request["action"];
switch (action)
{
case "refresh":
IF_Read();
break;
default:
break;
}
}
public void IF_Read()
{
UserModule module = new UserModule(this);
Response.Write(module.IF_Read());//返回消息数量
Response.End();
}
