I want to save the content of a textarea to a file. I have written my script as illustrated in that topic:
Save content of a div to new file with jQuery AJAX and PHP
I just save the content of a textarea instead of the div.. And that works!
The problem is that only the text that is displayed in the textarea at the beginning is saved to the file. I want the changed text of the textarea to be saved.
Would be very nice if anyone can help me editing this script to make it work.
Regards
Markus
maybe you´re looking for something like this:
it will always save the actual text when it changes (as i understood you)
$("#data2save").change(function() {
var bufferId =$("#data2save").text();
$.ajax({
method : "POST",
url : "saver.php",
data: {id : bufferId},
dataType: "html",
success: function(data){
alert("ok");
}
});
});
if it´s not what youre looking for u definetly need to make use of .text() to retrieve the textares content
var bufferId =$("#data2save").text();