var unreadNum=0; var oldTitle=document.title; document.documentElement.style.overflow="hidden"; function readNotification(){ unreadNum=0; if(document.title) document.title=oldTitle; $(this).parent().fadeOut(200); //reload data $('#panelGrid').jqxGrid('updatebounddata'); //$("#panelGrid").jqxGrid({ source: getAdapter() }); } function showNotification(newUnreadNum,lastedID,interval){ unreadNum+=newUnreadNum; $.ajax({ url: urlbase+"?cmd=get&id="+lastedID, dataType: "json", timeout : interval, success: function(data) { if(document.title) document.title='【收到'+unreadNum+"份消息】"+document.title; var notificationHTML='

未知

0.0.0.0

GET:0个 POST:0个 Cookie:0个

'; $("#webpushtipcontainer").remove(); $("#notifications-bottom-right").append(notificationHTML); $("#webpushtipcontainer").addClass('animated bounceInUp'); $('#webpushtip1close').click(function(event){$(this).parent().parent().fadeOut(200);event.stopPropagation();}); $("#newNotification").click(readNotification); $('#unreadNum').text(unreadNum); $('.notify_location').text(data.location); $('.notify_title').text(data.user_IP); $('.notify_digest').text("GET:"+Object.keys(data.get_data).length+"个 POST:"+Object.keys(data.post_data).length+"个 Cookie:"+Object.keys(data.cookie_data).length+"个"); $("#notifications-bottom-right").addClass('animated bounceInUp'); }, complete : function(XMLHttpRequest,status){ if(status=='timeout'){ var notificationHTML='

未知来源

网络错误

请检查网络连接

'; $("#webpushtipcontainer").remove(); $("#notifications-bottom-right").append(notificationHTML); $("#webpushtipcontainer").addClass('animated bounceInUp'); $('#webpushtip1close').click(function(event){$(this).parent().parent().fadeOut(200);event.stopPropagation();}); $("#newNotification").click(readNotification); $('#unreadNum').text(unreadNum); $("#notifications-bottom-right").addClass('animated bounceInUp');      } } }); }