Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Are there any tools/tricks to use on debugging AJAX response?

Usually, when I get 500 Internal Server Error from an ajax call, I don't get to see the details of the response (because you don't want to show them to users). And on the server side, I see only a line like "GET /xxx/yyy/ HTTP/1.1" 500 1150336.

Without modifying my client-end code (ie. html/js), unless the change is minimal and once-for-all, are there any handy tools or tricks that I can use to see the details of the AJAX response (either from the client side or the server side or both)?

Using packet-capturing programs like WireShark isn't an option here, as it is not streamlined with my debugging process and thus not handy.

Note that both the client-end and the server are running off from the same machine.

Thanks.

like image 633
tamakisquare Avatar asked Nov 09 '11 00:11

tamakisquare


1 Answers

  1. Turn on debug mode
  2. Fire up chrome
  3. Push cmd+option+j (open dev tools)
  4. Go to the network tab
  5. Click on the ajax request
  6. Click on the preview or response tab

Awesome! I just realized Chrome implemented rendering of the response as well.

enter image description here

like image 133
Yuji 'Tomita' Tomita Avatar answered Oct 11 '22 16:10

Yuji 'Tomita' Tomita