When you send a request via $.ajax, $.get, or $.post in jquery, you can test for the HTTP_X_REQUESTED_WITH header, looking for a value of 'XMLHttpRequest', a la:
function isajax() { return ((!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'); }
But what happens when you're using the jQuery Form plugin? Normally, things work fine. Below the cut for a serious caveat!
Continue reading jquery, the jquery form plugin, and detecting an ajax submit.

Recent Comments