Best debugging tool for debugging Ajax request in PHP

What is the best debugging tool to debug an AJAX request in PHP? I want to check if a method was run in class.php when calling an AJAX function.

For instance:

$.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; } 
+4
source share
4 answers

An easy way is to view the trigger in the browser itself.

Open website in Chrome browser

  • Press F12.

  • Click the "Network" tab. Reload the page to find all files loading.

  • select MyFile.php and then click on the answer tab to see ur respone.

You can also see other data, such as the time taken to respond, the initiator file, etc. using this method.

+11
source

As I understand it, this raises the question of how to debug PHP code, not the request itself. The request is easily viewed inside the developer tools of your browser. The only method I can come with is to add debug information to the response to the browser. That is, use the answer as feedback.

+4
source

I am using firefox console to see ajax request. It's good. Even you can use "Net" firefox. Both are available by default in firefox.

+2
source

The best debugging tool for Firefox is Firebug. This is an add-on that includes Firefox. You can add this add-on from the following link.

Download Firebug

+2
source

Source: https://habr.com/ru/post/1500107/


All Articles