views:

720

answers:

2

This question is specific to the Firebug plugin for Firefox. The actual functionality works, but I lost my ability to monitor and debug it in Firebug.

I had a website which used JSON to get data. In Firebug, I was able to monitor the JSON requests. It would show me each one of them, the headers, and the data that was returned.

I needed to change the server to which I submitted my JSON requests. In order to get cross-domain JSON to work, I used JSONP with the callback=? method. I got the functionality to work. However, I cannot monitor and debug my JSONP requests now in Firebug.

For the record, this in in Firefox 3.0.11 and I am using jQuery with the &callback=? param for my JSONP requests.

How do I get the JSONP requests to show up in Firebug?

+2  A: 

I'm not totally familiar with jquery's callback implementation but I assume it's injecting a script tag in the page to make the request. Most of the libraries do.

Thus, the requests should show up on the NET tab in firebug since it's not an XmlHttpRequest but a 'plain' old script tag with a src getting loaded.

seth
Also, a hint for other people fumbling with such an issue: when you select "Net", make sure that "All" is selected in the sub-type, and not "XHR" or "JS".
A: 

If you are using JSONP, the XHR will show up under the js tab of firebug rather than the xhr tab. The code should actually be making a request for a js file which then gets calls the callback method.

Dale Chen