开发者

get server response without using setinterval for chat applicaton php jquery

i made a chat application, here is the refresh code

   setInterval(function() {
      $('#Displ开发者_如何学CauDiv').load('show-chat.php?session=<?php echo $_GET['session'];?>');

   }, 1000);

And this keep loading in each second, that will slow down the perfomance of my Mysql. While i cheeked Facebook(firebug), they dont have anything like this to get response from server.

Please tell me the technique to do this.

Thanks in advance to all for reading and replaying this..


well setInterval is poor man's comit have a look at COMET

also see this answer Reverse Ajax implementation using php

also see this link How are the facebook chat windows implemented?

open firebug will you are on the facebook page open the net panel in firebug and go to xhr you will notice a continuous spinning wheel that is COMET ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜