Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Ajax request

I have a Rails application which generate HTML like this:

<a href="/ReadItLater/stock?qid=5618572&amp" data-remote="true">stock it</a>

When I click on this link in browser I can get information about AJAX request on Firebug, on Console tab. I can see the respond of the request:

$("#stock_5618528").hide();

enter image description here

But how can I set breakpoint on this line and debug this code?

like image 645
ceth Avatar asked Dec 01 '22 03:12

ceth


1 Answers

If you change your response to include the debugger keyword it should hit that as a breakpoint. So in this case the response would be:

debugger;
$("#stock_5618528").hide();

Obviously don't forget to remove that when it goes live. :D

like image 174
Richard Dalton Avatar answered Dec 04 '22 07:12

Richard Dalton