Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

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

 
 
Sandip Chitale
Guest
Posts: n/a
 
      11-20-2003
// 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');
document.body.appendChild(element)})())
// 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 = window.open("","console","width=600,height=300,res izable,scrollbars=yes");
// open a document in the window to display plain text
_console.document.open("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"));
}
viewFinalSource();



 
Reply With Quote
 
 
 
Reply

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 wildman@noclient.net ASP .Net 0 03-10-2008 08:54 PM
How to get the web page's html source code generated by javascript cttseng@csie.nctu.edu.tw 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



Advertisments