I'm wondering if it is possible to store data from variables to a json file ?
var json_object = {"test":"Hello"}
$.ajax({
url: "save.php",
data: json_object,
dataType: 'json',
type: 'POST',
success: function (json_object) {
console.log(json_object);
$("#data").text("Data has been saved.");},
error: function (json_object){
console.log(json_object);
$("#data").text("Failed to save data !");}
This is what I use to save data, now instead of storing Hello as a string I would like Helloworld to be a variable for example
var hello = world;