标签:js轮询服务器端
<script type="text/javascript"> function showUnreadNews() { $(document).ready(function() { $.ajax({ type : "GET", url : "bridgeAction.action", dataType : "json", success : function(msg) { if (msg.data) { if (msg.data.szdata) { if (confirm(msg.data.szdata + '来电 是否接听?')) { $.ajax({ type:"GET", url : "bridgejieAction.action", dataType : "json", success : function(data) { if (data.status=="success") { setTimeout('showUnreadNews()', 1000); } } }); } else { $.ajax({ type:"GET", url : "bridgejuAction.action", dataType : "json", success : function(data) { if (data.status=="success") { setTimeout('showUnreadNews()', 1000); } } }); } } else { setTimeout('showUnreadNews()', 1000); } } else { setTimeout('showUnreadNews()', 1000); } } }); }); } </script> </head> <body onload="showUnreadNews()">
标签:js轮询服务器端
原文地址:http://blog.csdn.net/maskdfe/article/details/37911459