jquery ajax提交中文乱码问题


function getdatadetail(area){
	var localPath = "<%=basePath%>";
	$.post(localPath+"showDataDetail.do?method=queryData",
			 {areaName:encodeURI(area.name),areaType:area.type,areaCode:area.code,dataTime:$('#dataTime').val()}
			,function(data) {
			$('#ajaxDiv').html(data);
			});
	 }





String areaName = decodeUTF8(request.getParameter("areaName"));


public static String decodeUTF8(String str){
		if (str != null) {
			try{
	        	str = java.net.URLDecoder.decode(str,"UTF-8");
			}catch( UnsupportedEncodingException e ){
				e.printStackTrace();
			}
		}
		return str;
	}

你可能感兴趣的:(java,html,jquery,Ajax,.net)