View Single Post
  #3 (permalink)  
Old 06-28-06, 01:58 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
I've never considered this before, since it's usually just form data which gets passed to the email client.
The tricky part would be to get all of the HTML into a form element.
Maybe this could be done by adding an <input type="hidden" id="pageSource" name="pageSource"> field and do somehting like this:
Code:
document.getElementById('pageSource').value="<html>"+document.getElementsByTagName("html")[0].innerHTML+"<\/html>"
Maybe somehting else could be used instead of .innerHTML (I'm thinking nodeValue but doubt it's valid in this case). outerHTML would be great but it isn't supported by many browsers.

I suspect there's a limit to the length of the value of a hidden field, maybe a <textarea> field could be used instead and hidden using styling.

I don't think there's a practical way to actually get the whole page to show up in the client and be sent as a text/html email. As I said, I've never tried this before...

EDIT: Ah, good point UnrealEd.
I wonder if ...body=<html>"+document.getElementsByTagName("htm l")[0].innerHTML+"<\/html>" would work.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.

Last edited by TwoD; 06-28-06 at 02:04 PM.
Reply With Quote