Posts Tagged with "ajax"

Detect an Ajax request in PHP

Posted by Stanislav Furman on August 24, 2017

If you would like to use same PHP code to handle both AJAX and non-AJAX requests, here is a quick and simple trick that you can use to check if the incoming request is AJAX. For our trick we will use a HTTP header called HTTP_X_REQUESTED_WITH. It is supported by all modern browsers that support AJAX. Therefore, it should work in 99% of cases.

Continue reading

Looking for an AJAX loading GIF image? Here is a good GIF image generator!

Posted by Stanislav Furman on February 14, 2012

It is a good practice to display an animated image when AJAX request is in progress. Need a nice loading GIFfor that? Use this online service to generate an animated GIF image to display on your page when AJAX is loading - http://www.ajaxload.info

Have fun!