js的comet各个浏览器封装lib

    SimpleComet是一个轻量级的comet的封装类, 能智能的识别浏览器,应用不同的comet技术,在firefox浏览器上使用ajax,在IE、opera浏览器上使用htmlfile,iframe.


 	// We fetch an excuse at random. 	$excuse = trim($excuses[rand(0, count($excuses))]); 	// If the excuse is too long, we get another one. 	if (strlen($excuse) --> 60) { continue; } 	// Finally, we push our excuse to the client. 	$comet->push($excuse); 	// 5 seconds delay before the next excuse. 	sleep(5); }   ?>


simplecomet能监听出链接是否已经断了,是不是很智能,只要负责服务端的输出就行. 
下载: http://www.mandor.net/files/simplecomet-1.0.zip

转载于:https://www.cnblogs.com/torome/archive/2011/03/10/1979944.html


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部