Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 12:00 PM
Sandip Chitale
Guest
 
Posts: n/a
Default Show the true html source of a web page (including that generated by script).

// Bookmarklet by Sandip Chitale (sandipchitale@yahoo.com)
// 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();




 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.