title: How to view JS code loaded with AJAX in browser?
body: <p>I have a JSP page, where some parts of the pages are loaded from the backend using AJAX. For example, when I first open the page, the URL is <a href="http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do" rel="nofollow noreferrer">http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do</a>. The page contains an "add user" button, which loads HTML content (containing a form etc.) from the backend to the div-element with id "addArea". The URL stays the same the whole time (naturally), as the request is done in the background.</p>
  
  <p>The problem I have is that the content loaded using AJAX is not completely viewable with any means. </p>
  
  <p>Using Firefox I can see the new HTML with the Firebug add-on and "Inspect element", but the content within the script-tags is not visible that way (also not in the "Script" tab in Firebug - only the originally loaded scripts appear there). If I use "View page source" in FF a page reload is executed and I don't see the newly generated content (I only see the content of page <a href="http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do" rel="nofollow noreferrer">http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do</a> as it was when first loaded).</p>
  
  <p>With Chrome I have the same problem as with Firefox.</p>
  
  <p>Using IE I see only the original source.</p>
  
  <p>Of course I can work around this by adding debugging mechanisms to the JS code and working half-blind, or moving parts of the JS code to external files etc., but if by any means possible, I would prefer to just view the code loaded using AJAX. Any suggestions, perhaps using some add-on?</p>
  
  <p><strong>Update:</strong> There is a better way: see the accepted answer for this question: <a href="https://stackoverflow.com/questions/9092125/how-to-debug-dynamically-loaded-javascriptwith-jquery-in-the-browsers-debugge/9092205#9092205">How to debug dynamically loaded javascript(with jquery) in the browser&#39;s debugger itself?</a></p>