jquery - Mulitple call ajax on the same page -
I am trying to create a chat application with jQuery without using setTimeout to reduce the number of AJAX requests I:
check the function (new) jQuery.ajax ({'url': './chat/check.php', 'cache': wrong, 'success': function ( Message) {if (messages.length) {$ ("# empty_chat"). Attachment (message); // write to chat wall} checkChat ();}}); } What's great on a simple page but the page on which other AJAX events (like navigation) are queued and nothing appears until the message is empty gives.
The cursor is also on the waiting position.
Is there any way to solve this?
Thanks, Adrian
In fact, unless you want to see the comet By that time, you need to vote for the message and setTimeout is fine.
The recapture that you set up with setup is called recursive that should be set to a set timeout or you are overflowable
setTimeout (checkChat , 2000); and the new operator needs to be removed and just do it
jquery.ajax or $ .ajax
Comments
Post a Comment