$("li").click(function(){
$.ajax({
type:"post",
url:"ShowBookAction.action",
data:"type="+$(this).attr("title"),
datatype:"json",
success:function(data){
}
我这个type为中文,后台request.getparamter()后为乱码,用new string重新编码不顶用,急求
http://my.oschina.net/u/1172409/blog/161555
data:"type="+encodeURIComponent(encodeURIComponent($(this).attr("title")))
http://blog.csdn.net/w33365/article/details/12772841
把data换成json格式,jQuery会为你在组装的时候编码;
如
data:{type:$(this).attr("title")}
data:{
"type":$(this).attr("title")
}
后台用json 接收就ok了