待解决的代码:
var isOpen=true;
var cho =null;
function chatWindow(){
var userId=document.getElementById("loginUser").value;
OnlineChatAction.checkUserChatRoom(userId,function checkState(result){
if(!result){
OnlineChatAction.checkMessage(function messageList(messageArray){
if(messageArray!=null){
if(isOpen){
isOpen=false;
cho = window.open("OnlineChat-Window.action","聊天信息","status=no,resizable=no,scrollbars=yes,toolbar=no,WIDTH="+600+",HEIGHT="+600);
}
}
});
}
});
}
setInterval("chatWindow()",1000);
这段代码的主要意思就是调用Action的方法检查是否有聊天消息!。。
需要解决的问题:
现在的问题就是消息弹出以后我把窗口关闭掉以后!isOpen的值还是false下次有消息就不会自动弹出来了,想请前辈给个解决方案
让窗口关闭之后isOpen=true!
如果JS不能实现后台代码实现也行