First off i'll state the obvious, i'm new to javascript,html, and web development tools.
var labels = {{ labels|tojson|safe }};
using console.log i was able to see the content of labels console.log(JSON.stringify(labels));
output:
[
{"id":"1","image":"1-0.png","name":"","xMax":"4802","xMin":"4770","yMax":"156","yMin":"141"},
{"id":"2","image":"1-0.png","name":"","xMax":"4895","xMin":"4810","yMax":"157","yMin":"141"},
{"id":"3","image":"1-0.png","name":"","xMax":"4923","xMin":"4903","yMax":"156","yMin":"145"},
{"id":"4","image":"1-0.png","name":"","xMax":"4956","xMin":"4931","yMax":"156","yMin":"145"}
]
It's clearly a list of dictionaries, so far so good, now there is new elements i want to append as it runs and WITHOUT REFRESHING THE PAGE Manually, it should auto update, so since i have some experience with python, i quickly thought about appending, something like that :
labels.append({"id":labels.length + 1,
"name":"",
"xMin":xMin,
"xMax":xMax,
"yMin":yMin,
"yMax":yMax
})
but it isn't working, how can i append that line?