当前位置: 代码迷 >> Ajax >> Jquery的ajax统制
  详细解决方案

Jquery的ajax统制

热度:316   发布时间:2012-11-15 15:16:13.0
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 来编码
  相关解决方案