What is the best debug tool to debug AJAX requests, and see what happens to my PHP code which is triggered via AJAX? I want to check whether the method in the class.php has been fired when the AJAX function is calling.
Eg:
$.ajax({
url: 'classes/MyClass.php/GetItems',
data: {
'catgry': cat
},
dataType: 'json',
success: function (data) {
alert("data recived!");
},
error: function (jqxhr, textStatus, errorThrown) {
alert("error");
}
});
MyClass.php
public function GetItems($catgry) {
$ret = $itmObj->GetItemsByCat($catgry);
return $ret;
}
The simple way is view the trigger in browser itself.
Open the website in chrome browser
Click F12.
Click on Network tab. Reload the page to find all the files getting loaded.
select the MyFile.php and then click on the response tab to see ur respone.
You can also see other details like time taken for response, initiator file etc. by this method.