摘要:
1.如何实现一个轮询?function getMessage(url,callback){ var XHR=new XMLHttpRequest(); XHR.open('get',url,true); XHR.onreadystatechange=function(){ if(XHR.readyState==4){ //do something if(callback){ callback(XHR.responseText); } } }; XHR.send(); setTimeout(function(){getMessage(url,... 阅读全文