Return to Snippet

Revision: 16406
at August 3, 2009 11:29 by Wilco


Initial Code
function isAjaxRequest() {
	return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
}

Initial URL


Initial Description
Determines whether or not the page has been requested directly, or through AJAX. This can allow for combining a page and related AJAX responses within the same script.

Initial Title
Check for AJAX Request

Initial Tags
ajax, javascript, php

Initial Language
PHP