Manuel Lemos - 2007-11-21 16:36:46 -
In reply to message 1 from Satish Kumar
I just noticed from the subject that you meant the difference between AJAX and COMET, rather than HTML.
AJAX and COMET are for the same purpose, allow the browser to communicate with the server without page reloading.
The difference is that with a single COMET request you can get multiple asynchronous responses from the server. With AJAX you need to perform multiple requests to get responses to multiple actions.
With COMET you can not only request the server to execute an action, but also return the progress of execution of the action until it is done.
Lets say you want to execute a long task made of small tasks. With COMET you can tell the user what exactly what task is being executed on server within a single request, therefore within a single transaction.
With AJAX, either you perform multiple requests to poll the status of an action to let the user know what is going on, or you wait until the whole task is done without giving user feedback.
You can also use a single COMET request to execute actions get feedback that you don't know when they will happen.
You can use this to implement a chat service that shows what each user said when it happens.
To do the same with AJAX, you need to keep polling the server asking if anybody said anything. Not only is a much slower approach, but it also takes more bandwidth.