Return to Snippet

Revision: 1117
at September 12, 2006 04:38 by TC

Initial Code
function isAjax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 

Initial URL

Initial Description
A simple function to check if the request comes from an AJAX XMLHttpRequest.
Use it if your page should behave differently when called from AJAX.
Comes from jquery mailing list:

Initial Title
Check for AJAX Request

Initial Tags
ajax, php

Initial Language