Forum Moderators: open

Message Too Old, No Replies

See javascript generated html code

See final html code which is generated by the page

         

Bluepixel

3:22 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



Hi,
Is there a tool that let's me see the full source code of a website when the javascript has been executed.

I would like to see the html source code that the browser actually renders. (including the parts that were generated by the javascript code snippets, eg. google adsense code,etc...)

Bernard Marx

3:38 pm on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a start. IE-only, and even uses a deprecated tag, but easily adapted.

Type this into your address bar:

javascript:'<xmp>'+document.documentElement.outerHTML+'</xmp>'

If you like, save it a favourite. Then you'll have easy access.

Bluepixel

4:08 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



Thank you!
While googling for that IEmethod I found a command that works in firefox/mozilla as well:

javascript:window.open('about:blank').document.write('<pre>' + unescape((new XMLSerializer()).serializeToString(document).replace(/</g, '&lt;')) + '</pre>')