Below is the original code I wrote in JavaScript:
var wt_val = [];
for (i = 0; i<human_wt.length; i++){
var mult;
mult = data_list[basket_list[button_port_name][i]].map(x => x*(wt[i]/100));
wt_val.push(mult);
}
The variable wt_val
is either a list or a list of lists.
Next, I am sending this data to the server.
$.ajax({
type: 'GET',
url: '/add',
data: {hoot: wt_val},
success: function(results){
alert("success");
},
error: function(error) {
}
});
No errors occurred at this point.
However, no value is being received.
app.route('/add', methods=['GET'])
def sum():
start = request.form.getlist('hoot[]')
print type(start)
print len(start)
The length of the received data is 0.