views:

80

answers:

2

So in my javascript I'm making an ajax call to a service on my website. Whoops, something fails. No problem. Here's what I'd do in Firefox:

  1. Open the firebug console
  2. Find the failed Ajax call and click the + sign to see more info.
  3. The response tab has the raw HTML. Who wants to read all that? I click the HTML tab.
  4. Ah, the nicely formatted HTML returned by Django shows my divide by zero error.

Now here's what I currently do in Chrome:

  1. Ctrl+Shift+J to open the Developer Tools
  2. Go to Resources
  3. Scroll down to the Ajax call and click
  4. Once again, I see raw HTML. Still don't want to read all that, but since there isn't an HTML tab I copy and paste into a text editor.
  5. Save html file
  6. Open html file in browser so I can read the error HTML returned by Django

So on to the question. Is there anyway to view the HTML response from an Ajax call rendered in the browser without having to copy and paste the raw html to a text editor?

+1  A: 

Nope, there is currently no way. When you goto Developer Tools > Resources > XHR Tab > And click on your resource (on the left), you see two tabs. The first one being Headers (which is raw) and Content which is raw as well.

Mohamed Mansour
Yeah, I figured as much but figured it wouldn't hurt to ask. I'll give this another day and, since you were nice enough to answer, accept this answer.
Eric Palakovich Carr
Perhaps it would be nice to make a third tab that we can call viewer. So depending on the content type (json, xml, html, plain) it will render differently. Feel free to submit a feature request in http://crbug.com/new and I can mark that bug as available so people can triage it, assign it, or someone can contribute a patch to it. Shouldn't be hard to implement since its all JavaScript and everything is available.
Mohamed Mansour
Will do. Thanks again.
Eric Palakovich Carr
Done. http://code.google.com/p/chromium/issues/detail?id=48389
Eric Palakovich Carr
Done, added it to triage phase, great feature to have. Thanks!
Mohamed Mansour
+1  A: 

Just for your information, while Firebug Lite does not have a NET panel, it does have a XHR watcher feature with the same look and feel of Firebug. Of course, Firebug Lite is very limited compared to Chrome Developer Tools, but for some specific tasks like CSS editing or XHR inspection, Firebug Lite does the job very well.

The current stable version shows you the HTTP headers, GET and POST variables, and the response text. But the next version 1.3.1 (which will be released soon) includes the HTML viewer, XML viewer and the handy JSON viewer (for both request and response data).

This feature will be included in the next release 1.3.1b2 (probably the last beta version for the 1.3.1 version), but if you want to see it running right now you can use the developer channel:

http://getfirebug.com/firebuglite#Developer

Pedro Simonetti