ajax请求时候乱码

$.ajax({
        		url: "${ctx}/floatAdv/floatAdv.do?action=saveFloatAdvForm",
        		contentType: "application/x-www-form-urlencoded; charset=utf-8", //默认值,适合大多数应用场合
        	    data: {"adName":adName,"isOpen":isOpen,"remark":remark,"context":context},
        	    type : "post",
        	    success: function (text) {
        	    	form.clear();
        	    	showFCKDetailDesc.html("");
        	        FloatAdvDataGrid.reload();
        	        FloatAdvAddOrEditOnCancel();
        	    },
        	    error: function (jqXHR, textStatus, errorThrown) {
        	        alert(jqXHR.responseText);
        	    }
        	});

// 当ajax的post请求时候出现乱码 可以机上contentType来解决 
// ajax的get请求乱码可以在tomcat配置URIEncoding="UTF-8"来解决

相关推荐