Is it possible to save the content of a variable to a file with JQuery.
I have a html form (letter) which is saved and edited later on again by the user.
I capture the whole html document in a variable, but now I want to write that variable to a file and use a cron to save it back to the DB.
here is my code thus far
$( document ).ready(function() { var isDirty = false; $("textarea").on("change", function() { isDirty = (this.defaultValue !== this.value); if (isDirty) this.defaultValue = this.value; }); $("input").on("change", function() { isDirty = (this.defaultValue !== this.value); if (isDirty) this.defaultValue = this.value; }); }); function getPageHTML() { var vDocText = "<html>" + $("html").html() + "</html>"; console.log(vDocText); }
So I want to end up saving the content of vDocText
to a file and send the file back to 4D (my database) with a php cron process.