$.ajax({
type: "POST",
dataType:"json", //如果返回数据是JSON格式,dataType请指定json
url: "inputCodeAction",
data: "dictType=" + $(this).attr("dictType") + "&inputText=" + obj.value + "&random=" + Math.floor(Math.random() * 10000 + 1),
success: function(result){
alert(result);
}
type: "POST",
dataType:"json", //如果返回数据是JSON格式,dataType请指定json
url: "inputCodeAction",
data: "dictType=" + $(this).attr("dictType") + "&inputText=" + obj.value + "&random=" + Math.floor(Math.random() * 10000 + 1),
success: function(result){
alert(result);
}
});
type属性值改为"POST"时,action不会出现中文乱码问题
dataType属性可以设置为xml,json,script,html多种返回格式!