jQuery.post()函数

来源:互联网 发布:2016淘宝店铺名字大全 编辑:程序博客网 时间:2024/06/06 10:06
jQuery.post(url,data,success(data, textStatus, jqXHR),dataType) 

URL 必需。规定把请求发送到哪个 URL。
data 可选。映射或字符串值。规定连同请求发送到服务器的数据。
success(data, textStatus, jqXHR) 可选。请求成功时执行的回调函数。
dataType 可选。规定预期的服务器响应的数据类型。
默认执行智能判断(xml、json、script 或 html)。

该函数是简写的 Ajax 函数,等价于:

$.ajax({   type: 'POST',   url: url,   data: data,   success: success,   dataType: dataType }); $.ajax({     type: "get",     url: "test.jsp",     datatype: "json",     contentType: "application/json",    data:"id=1234",     success: function(result){        alert(result);     }   }); 
0 0
原创粉丝点击