Sunday, January 25, 2009

Bookmarklet - View Rendered HTML Source Code

Developing DHTML applications can be challenging, often the rendered HTML source code is dynamically assembled via JavaScript or AJAX and is dramatically different than the original source code of the Web page.

To view the raw rendered source code of an HTML page, save the following link as a bookmark, then navigate to the HTML page and click the bookmark.

javascript:document.write('<pre>' + document.body.innerHTML.replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</pre>');

No comments: