The problem of .serialize() passing Chinese garbled characters in the ssm framework

solution, add

			var params = jQuery("#carApply form").serialize();
			params = decodeURIComponent(params, true);

  for example js

$("#car_btn").click(function() {
			var params = jQuery("#carApply form").serialize();
			params = decodeURIComponent(params, true);
			//alert(params);
			$.ajax({
				url : "${APP_PATH}/car",
				type : "POST",
				data : params,
				success : function(result) {
					alert(result.msg);
					//close the modal
					$("#carApply").modal('hide');
				},
				error : function() {
					alert("Failure!");
				}
			});
		});

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324933251&siteId=291194637