87,922
社区成员
发帖
与我相关
我的任务
分享
var id1=0;
$(document).ready(function(){
getMessage();
id1=window.setInterval("getMessage()",1000);
});
function getMessage(){
var sendUrl="rnd=" + Math.random();
$.ajax({
type : "post",
async : true,
url : "getMessage.asp",
data : sendUrl,
success : function(msg){
if(msg!=lastMsg){
lastMsg=msg;
$("#content").html(msg);
window.document.title="【有新消息】-艾恩AJAX聊天室!";
play();
$("#span1").html("");
}
if(scroll){
$("#content").scrollTop(2000);
}
},
error : function(){
$("#span1").html("<img src='img/loading.gif' alt='' />");
}
});
return true;
}
var time1=null;
$(document).ready(function(){
zt();
//time1=window.setInterval("zt()",2000);
});
function zt(){
$.get("zt.asp?randID="+Math.random(), function(data){
$("#zt").html(data);
});
}
if(msg!=lastMsg){
lastMsg=msg;