1. 程式人生 > >dojo中 xhr.post向後臺傳參出現亂碼

dojo中 xhr.post向後臺傳參出現亂碼

在js檔案中加入

headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, 

 

var content = {"field":"引數名稱"};
xhr.post({
	url :  config.contextPath+"/getData/showfields",
	handleAs : 'json',
    content:content,
    headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, 
    load : lang.hitch(this, function(response){
					this._pointFieldsAlians(feature,response);
	}),
	error : function(response, ioArgs) {
		}
	});