Hi, how do i go about assigning the source of my page to a variable?
Why do i want to do this?... because i have a table generated from a database using ASP, i want to save the generated page as a static HTML page on the click of a button. I understand javaScript cannot write to file so if i can assign the source to a variable and stuff the vairable into an <input> then i can use ASP to do the writin.
I have managed so far to get all text (but no HTML) from my page using some javascript i found on another thread, and i can output it into a <textarea>.
onload = function() {
test = document.body.innerText;
document.getElementById("textspan".innerText = test;
}
and...
<textarea id="textspan" cols="80" rows="20"></textarea>
The output however is not formatted in anyway.
I also tried using innerHtml but this didnt work at all.
Any ideas on how can get round this?
Thanks
Pete
Why do i want to do this?... because i have a table generated from a database using ASP, i want to save the generated page as a static HTML page on the click of a button. I understand javaScript cannot write to file so if i can assign the source to a variable and stuff the vairable into an <input> then i can use ASP to do the writin.
I have managed so far to get all text (but no HTML) from my page using some javascript i found on another thread, and i can output it into a <textarea>.
onload = function() {
test = document.body.innerText;
document.getElementById("textspan".innerText = test;
}
and...
<textarea id="textspan" cols="80" rows="20"></textarea>
The output however is not formatted in anyway.
I also tried using innerHtml but this didnt work at all.
Any ideas on how can get round this?
Thanks
Pete