Traditionally I use FireBug to debug my AJAX requests. It lets you examine both the contents of your request as well as the response that was sent back from the server. (it
PHP:The reason could be that the requested-url (php page) has errors. But as many hostings has disabled the error-output, you need to enable that in requested .php file (put somewhere in the top of file):
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
After that, you will see the response there.
To hook manually:
(function() {
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
this.addEventListener('load', function() {
console.log(this);
});
origOpen.apply(this, arguments);
};
})();