Hey guys, wondered if anybody could help me out with a pretty simple piece of code that has been driving me crazy for the past few days?
I am trying to create a client side self sustaining message board system using basic DHTML to keep all of my colleges up to date.
I have successfully built functions to control the posting of messages, but as I try to create a method which completes an overwrite/save as command over the same html file I run into some issues.
I am currently using the following code to complete this task:
function saveChanges()
{
var newHtml = document.documentElement.outerHTML;
document.open("text/html","replace");
document.write(newHtml);
document.close();
document.execCommand("saveas", false, "C:/Documents and Settings/Matt/My Documents/Projects/iSpace/users/default.htm");
}
Despite defining the execCommand line as best as possible, the save function continues to call the save as prompt box which I am trying specifically to avoid.
I need to have the current page overwrite the old page (default.htm) upon activating this function in the defined directory with no "save as" prompt.
The current code does save the file once the user points the save function into the correct directory using the prompt so as far as I can tell, it is only the execCommand line I must have incorrect.
Any ideas people?