日期:2014-05-16  浏览次数:20711 次

Jquery的ajax控制
GBK环境下,通过POST 提交ajax需要如下方式:
jQuery.ajax({
  url: url,
  type: "post",
  cache: false,
  dataType : "text" ,
  data: "resourceid="+groupId+"&bulletin="+encodeURIComponent(bulletin),
  contentType: "application/x-www-form-urlencoded; charset=utf-8",
  success: function(data){
if('success' == data) alert("发布成功!");
  }
});

对中文字符或特殊字符需要通过 encodeURIComponent 来编码