大佬教程收集整理的这篇文章主要介绍了彗星 – JSONP长轮询总是加载,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我使用的一些代码..它使用jQuery,但我认为你可以弄清楚你需要什么,并使用你的库来做同样的事情.
<script type="text/javascript"> function poll(){ $.getJSON('/updates',function(json){ //reconnect since we successfully received data and disconnected poll(); //add something here to do whatever with the recieved data }); } /*call the poll function after document has loaded with setTimeout if called before the document finishes loading completely it will cause a constant loading inDication*/ setTimeout(poll,1); </script>
以上是大佬教程为你收集整理的彗星 – JSONP长轮询总是加载全部内容,希望文章能够帮你解决彗星 – JSONP长轮询总是加载所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。