Ajax

来源:互联网 发布:网络数据采集器 编辑:程序博客网 时间:2024/06/06 20:07

$.post()以post方式发送ajax

格式:jQuery.post(url,[data],[callback],[type])

参数1:url,请求路径

参数2:data,请求参数

参数3:callback,回调函数

参数4:type,返回内容格式,xml,html,script,json,text,_default

服务器响应码为:application/json;charset=UTF-8,回调函数data类型是json对象

服务器响应码为:text/html;charset=UTF-8,回调函数data类型是字符串.