Make AJAX call wait for event in php
问题 I do not know if my tile line is clear enough... My problem is: I have a JS application that needs to wait for an event on the server. At the moment it polls continuous the server data via XMLHttpRequest every second. What I am thinking about is: Is it possible to make the call wait until for example a variable in PHP changes? I hope that my question is clear enough. Thanks! 回答1: You're looking for long polling (colloquially known as Comet). There are many examples on SO and elsewhere. http:/