I am currently working with the Spring Framework and AngularJS in JavaScript. I have successfully made an AJAX request, but encountered an issue when trying to remove certain keys and values from the response data. Here is my code:
$.ajax({
type: 'POST',
dataType: 'JSON',
data: JSON.stringify(search),
contentType:"application/json; charset=UTF-8",
url: '/yboard/select',
error: function() {
alert("Loading failed!");
},
success: function(returnJSON) {
if (returnJSON.success) {
var result = JSON.stringify(returnJSON.items);
console.log("no : " + result);
} else {
alert("it's failed");
}
}
});
The output is:
no : [{"boardID":"9b5199799c908e48051e2e131f2d35cc","no":204,"capital_stock":"","pno_stock":"3204000336","pname_stock":"HEATER","storage_code_stock":"C03","storage_name_stock":"A","price_indicator_stock":"M","unit_stock":"EA","stock_amount_stock":"12.00","tracking_no_stock":"015","standard_stock":"WATLOW: SFRE","client_code_stock":"1193","client_name_stock":"aaa","priority_stock":0},{"boardID":"6a11d21aa400ff6c94d7d7a21b762433","no":203,"capital_stock":"","pno_stock":"3204000328","pname_stock":"HEATER","storage_code_stock":"C03","storage_name_stock":"A","price_indicator_stock":"M","unit_stock":"EA","stock_amount_stock":"12.00","tracking_no_stock":"015","standard_stock":"SFRE","client_code_stock":"1153","client_name_stock":"bbb","priority_stock":0}]
I attempted to remove the 'boardID' and 'priority_stock' keys using the following code:
delete returnJSON.items['boardID']
delete returnJSON.items['priority_stock']
or
delete result['boardID']
delete result['priority_stock']
However, I was unsuccessful in removing them. What could be causing this issue?