Please help, i wrote some code to save contents in the textarea as file, i pass textarea value to server side PHP code using Ajax. Here my Ajax code:
function saveFile()
{
document.getElementById("save").childNodes[0].nodeValue="Saving";
var values = {
"txTitle": document.getElementById("title").value,
"tex": document.getElementById("textar").value
};
$.ajax({
url: "SaveFile.php",
type: "POST",
data: values,
cache: false,
success: function(data){
document.getElementById("save").childNodes[0].nodeValue="Save";
}
});
return false;
}
And here the code in SaveFile.php file:
https://txeditor.com/jie90r5j0nn