I am trying to write save as dialog with javascript,
I have a content of data, and I want to allow the user to save it,
I managed to get the code below to work, but this code is changing the html data,
So my question is:
1)How can I retrived the html data back, as it was before I the click on the button?
2)Can I do it more elegant way?
<script type="text/javascript">
function saveChanges()
{
var oldHtml = document.documentElement;
document.open("text/html","replace");
document.write("Hello");
document.close();
document.execCommand("saveas", false, "default.htm");
}
</script>
<body>
<button onclick="saveChanges();">Click to save123</Button>
</body>