/ Published in: PHP
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isAjaxRequest() { return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); }