Modify a JSON file with $ getJSON (JavaScript)

1

I have the following code:

 $.getJSON("config.json", function(json) {
        json.Lanzador.nombre = nombre;
 });

where:
name: is the value I want to assign;
config.json: is the json file that I want to modify
json.Lanzador.nombre: follow the structure of the json file.

{
    "nombre1":[..],
    "Lanzador": {
        "id": 0,
        "nombre":"valor"
     }
}


I want to modify the json file but it is never updated.
Thanks in advance

    
asked by Eloy 17.11.2017 в 11:02
source

0 answers