Using AJAX from PHP is very easy. All you need is the
JavaScript functions for sending the XMLHttpRequest and then handle the Http
Response. It will simplify development since you place all your AJAX related code in a single JavaScript file and reference it from anywhere you need AJAX.
There is another way of getting the same result from PHP
without using the XMLHttpRequest object. I personally do not like the concept
because it is missing one of the main ingredients of Asynchronous JavaScript and
XML (AJAX), XML. This concept is good for the old browsers with no supports for XMLHttpRequest object, but as all the newer versions are supporting XMLHttpRequest
object you can use AJAX for the common browsers.
By
Babita Baliarsingha