Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out which Javascript causes an Ajax request?

I'm having a problem with a Java JSF application: In a certain case, a user action causes an Ajax HTTP request that updates the UI correctly, but then immediately a second request is triggered, causing a second, incorrect update.

How can I find out (preferably using Firebug) where exactly that second request is triggered? There's a lot of minified framework JS code, so I don't know where to place breakpoints. Setting the form onsubmit handler to console.trace did not help, I suppose because these are independant Ajax requests.

like image 447
Michael Borgwardt Avatar asked Dec 28 '10 09:12

Michael Borgwardt


1 Answers

While trying out the suggestions in the answers, I found that Firebug already has exactly what I need out of the box: the Console tab displays all requests, and for Ajax requests it shows the file and line number where they originate, which tells me where to set my breakpoint...

like image 143
Michael Borgwardt Avatar answered Sep 29 '22 14:09

Michael Borgwardt