dan
dan

Reputation: 1080

How to view dynamically generated source code in browser

This is not a question about a bug in my code, but a general one about how source code is refreshed in browsers. It does relate to debugging code so I think it's okay to ask here.

Essentially I have a rails app which renders partials using ajax. I'm trying to do some debugging, but the source code viewable in the browser (Chrome/Saf/FF) does not update when the partial is rendered, making it hard to debug the markup generated by the partial. Is there a way of accessing the partial code through the browser?

I have dynamically generated id tags and want to have a look at what's being produced.

Upvotes: 0

Views: 420

Answers (2)

Jay-Ar Polidario
Jay-Ar Polidario

Reputation: 6603

  1. Press F12
  2. Go to "Network" tab
  3. Click "XHR" amongst others like "All", "JS", "CSS", etc.
  4. Visit the page and do the AJAX call
  5. Click the new Network request that will show right after
  6. Click "Preview" / "Response" tabs (whichever you need to inspect) amongst others like "Headers", "Cookies"

Upvotes: 1

I think your question is pretty bad, but I'm not one to downvote.

I googled "see dynamic content in source" and got the answer, jest because I wanted to "let me google that for you", but SO forbids it :(

Unless I'm wrong about what you're asking, any dynamic content is displayed in browser's developer tools, which in FF is under F12 in inspector.

Upvotes: 0

Related Questions