Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question: how to get full HTML of document?

Status
Not open for further replies.

d4n0

Programmer
Jun 26, 2003
9
GB
Hi,

Simple question (i hope ;-) )
How can I get the full HTML of a document(as a string)?
This would have to include the values of (editted) inputs.

Basically, I need to write a function for a button which saves a client completed html document to the server and so I'm trying to get everything as a string so I can write it to file.

Thanks a lot,

Dan.
 
if you want to do this client-side, it could be done in two steps:

1. get the html of the document:
document.getElementsByTagName('html')[0].outerHTML);

2. read through all form elements and save their values...you're in for a real treat, since you'll have to determine the form element's type, then determine the best way to extract its value...e.g., for a SELECT, you'll have to iterate through all its options and see which ones are selected


=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
hai guys...
I'm Yuki... ^__^
nice to meet u all in this forum... =P
Actually i also face the same prob as d4n0 face it... :(
i have to create a save button for client so that they can save the page that they want as HTML into their PC.
...but the function can work probably in IE6.0 but unluckly it cant work in Netscape7.0
I hope that some1 else can help me to solve this headache prob...10x anyway... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top