output page source

  • Thread starter Thread starter Slipperman
  • Start date Start date
S

Slipperman

i'm sure everyone has used the View Source option off the rmb menu to look
at the source of a page. question: is there a way to output the source of a
page to a file at run time via a button or something on the page itself??
 
Hi, Slipperman,

Try on the client-side the following:

document.documentElement.outerHTML

It returns everything between the <html></html> tags, including these.

Greetings
Martin
 
Slipperman said:
i'm sure everyone has used the View Source option off the rmb menu to look
at the source of a page. question: is there a way to output the source of a
page to a file at run time via a button or something on the page itself??

Well, browsers usually provide
File->Save As
in their menu, with IE you can try client side JavaScript
<input type="button" value="save page"
onclick="if (document.execCommand) {
document.execCommand('SaveAs');
}">
 
Back
Top