I wanna post a lot of same field values to server in Jquery ajax, I can do it via adding all values to url, but I wanna know how to do it using data attribute. There must have an equal way.
$.ajax({
type : "POST",
url : 'abc.action?name=5&name=6',
data : {
name : 2,
name : 3
},
error : function() {
console.error("operate failed");
},
success : function(data) {
console.log(data);
}
});
In above code, the request send 5, 6 and 3 to server, but not 2.
Maybe this problem will be different using different server side, I use Struts2.