tags: ajax
Traditional:true, : Prevents deep serialization and prevents data from being available in the background
/ / Multi-select delete
function delManyComm(){
var result=new Array();
var count=0;
$(".check_btn").each(function(){
if($(this).is(':checked')){
result.push($(this).val());
count++;
}else{}
});
alert(result);
if(result==null || result.length==0){
Alert ('Please select at least one piece of data');
}else{
//The popup reminder appears after the deletion is successful.
Dialog.confirm ('Warning: Are you sure you want to delete?', function(){
$(function(){
$.ajax({
type:"post",
url:"deleteManyUser",
data:{"ids":result},
dataType:"json",
traditional:true,
success:function(res){
if(res.status == '1'){
Dialog.alert("delete successfully!", function(){
httpGet("index","");
});
}else{
Dialog.alert("delete failed!");
}
}
});
});
});
}
}
</script>
Background sections: // json package used: com.alibaba.fastjson...
From https://blog.csdn.net/yhj19920417/article/details/48690439, thanks to the author's selfless sharing. 1, the front desk in the array variable jsp: 2, the property is provided in ajax: Ajax code ex...
Front End Page JS Write: Import Ali's JAR package: Background Java server Receive: Entity class properties correspondence parameter name: ...
Use Ajax to pass the JSON array to MVC background front end Front -end code: Background code:...
surroundings Reception to pass parameters to the background Reception using ajax Background use springMVC Transmission parameters are a plurality of objects N JSON object and JSON string In SpringMVC ...
Passing data in ajax can be used Background reception can be used: Note: The key is the $.ajax({traditional: true,}) setting, not the next String[] checkedIds can't receive the value. &n...
Ajax pass array: Ajax pass object: ...
Examples ...
Backstage $.ajax({ url: “/bill/distribute”, type: “post”, data: {“ids”: 1,2,3,4,5,}, dataType: “json”, success: function (data) { Global.success(success...
If you want to use ajax to pass the array to the background,traditional must be set to true。...