The problem that I have is, that I want to store data that I got in JavaScript into a JSON file.
For example the JSON file at the beginning looks like this:
{
"ip": "none",
"user": "none"
}
Now I have defined to JavaScript variables:
const ip = '127.0.0.1';
const user = 'me225hey';
I've already tried the following:
$.getJSON( "path/to/foo.json", function( data ) {
data.ip = ip;
data.user = user;
});
This way I could only retrieve the data but not store it. After searching in the internet I could only find a way to retrieve the data.
If it isn't possible to store data in a JSON file by JavaScript code. Where should I store my data otherwise? I can't use SQL for that. It should be locally and possible in Angular.