Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Show the true html source of a web page (including that generated by script).

Thread Tools

Show the true html source of a web page (including that generated by script).

Sandip Chitale
Posts: n/a
// Bookmarklet by Sandip Chitale ((E-Mail Removed))
// Function: Show the true html source of a web page (including that generated by script).
// Usage: 1. Copy these to a file (say - 'c:/bookmarklets/viewfinalsource.js')
// 2. Visit any website
// 3. copy and paste the following line in your address bar starting with the word 'javascript:'
// javascript:void((function() {var
element=document.createElement('script');element.s etAttribute('src','c:/bookmarklets/viewfinalsource.js');
// 4. Alternatively, create a bookmark (or also a Links toolbar shortcut in case of IE) for it to access the functionality
with a single click.
function viewFinalSource() {
var _console = null;
// open a window the first time we are called, or after an existing
// console window has been closed.
if ((_console == null) || (_console.closed)) {
_console ="","console","width=600,height=300,res izable,scrollbars=yes");
// open a document in the window to display plain text"text/plain");
var gt = /\>/g;
var lt = /\</g;
var el = /\n\s*\n/g;
_console.document.writeln(document.documentElement .innerHTML.replace(gt,">\n").replace(lt,"\n<").rep lace(el,"\n"));

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM
RE: Page.User.IsInRole True for AD group in VS.NET not true on samemachine once published ASP .Net 0 03-10-2008 08:54 PM
How to get the web page's html source code generated by javascript Javascript 2 11-21-2006 03:44 AM
debug="false" in web.config and <%@ debug="true" ...%> in aspx file => true or false? André ASP .Net 3 08-28-2006 12:02 PM