I have a dynamic editable table. Once the user finished the edit with the submit button i need to send JSON stringify data to python flask.
This is the javascript that on button click create the alert with the JSON object... what should i add in the same function to send this data to python flask and render an Html template?
$(function () {
$("[id*=btnFirstGenerateJson").click(function () {
var array1 = {};
$("[id*=tblfirstTable] .DataRow").each(function () {
var option = $(this).find('td').eq(1).find('select').children("option:selected")
if(option.length>0){
value = option.text();
} else {
value = $(this).find('td').eq(1).text().trim();
}
if (value!=undefined) {
k = $(this).find('td').eq(0).text().trim();
value = value.replace(/\t/g, '');
value = value.replace('\n',' ');
array1[k]=value
}
});
alert(JSON.stringify(array1));
});
});