Pass the array with ajax to the background: traditional: true,

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>

Intelligent Recommendation

springMVC, foreground ajax pass JSON array parameters, how to receive background

Background sections: // json package used: com.alibaba.fastjson...

_014_js_JavaScript ajax pass in the background using the request receiving array example

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...

Use AJAX to pass the JS object array to the Java background server

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

Use Ajax to pass the JSON array to MVC background front end Front -end code: Background code:...

SpringMVC pass parameters via ajax list objects or background objects to pass array

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 ...

More Recommendation

Ajax pass array

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 and object

Ajax pass array: Ajax pass object:  ...

ajax pass an array parameter

Examples   ...

ajax pass an array to springmvc

Backstage $.ajax({ url: “/bill/distribute”, type: “post”, data: {“ids”: 1,2,3,4,5,}, dataType: “json”, success: function (data) { Global.success(success...

Using ajax to pass an array

If you want to use ajax to pass the array to the background,traditional must be set to true。...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top