[code="javascript"]
$.ajax({
url : './data.do?action=unregister',
dataType : 'json',
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
timeout : 300000,
data : {
serviceNames : serviceNames
},
success : function(data) {
jAlert('成功注销服务!', 'message');
oTable.fnDraw();
},
error : function(request, status, error) {
BRICK.ajaxError(request, status, error);
}
})
[/code]
上面代码,用get,设置了编码为UTF-8,依然乱码。
[code="javascript"]
$.ajax({
url : './data.do?action=unregister',
type : "post",
dataType : 'json',
timeout : 300000,
data : {
serviceNames : serviceNames
},
success : function(data) {
jAlert('成功注销服务!', 'message');
oTable.fnDraw();
},
error : function(request, status, error) {
BRICK.ajaxError(request, status, error);
}
})
[/code]
上面代码,用post,默认使用UTF-8,没有乱码。
请求方法一为何不行?