JavaScript question - how to save a created document within browser
I'm a JavaScript newbie working on a HTML/JavaScript program to take user form data, convert it to a narrative form (like "<user's name> is a <a> year old <b> who comes in for <c>"...), and save the resulting document. I realize that JavaScript does not allow writing to a file but I was thinking I could save the resulting narrative document manually using the browser's 'File/Save Page As' feature. I can get the narrative to display in place of the form but it apparently isn't within a saveable document, because I can't save it or even duplicate the page in another window. I named the form 'x', and can print the name for example with 'document.write(x.name.value)'. Anyone know how to do make document.write print into a saveable document, or is this not possible? I could print the narrative back into a large text field in the original form and then save it but this would be an unsightly kludge. Thanks for any ideas.
|