ajax post提交

var url = path+"/jxkh/jxkh!getAjaxKhZbk.do";    
console.log(url);
  $.ajax({
    url: url,// post这里不是some.do?date="+str
    type: 'post',
    data:"zbkId="+zbkId+"&zbkLevel1Id="+zbkLevel1Id+"&zbkLevel2Id="+zbkLevel2Id,
    async: false,
    dataType: "text",         
    contentType:"application/x-www-form-urlencoded; charset=utf-8", 
    success: function(data) {
      data = eval('('+data+')');
    }
  });

url 是有长度限制的。

get请求能写在url中。
post,是写在data中的。

原文地址:https://www.cnblogs.com/chuningning/p/9121314.html