jQuery对Ajax的支持
$.ajax(options)常用设置项url - 发送请求地址type - 请求类型 get|postdata - 向服务传递的参数dataType - 服务器响应的数据类型 text|json|xml|html|jsonp|scriptsuccess - 接收响应时的处理函数error - 请求失败时的处理函数script typetext/javascript$(function(){$.ajax({url:/ajax/news_list,type:get,data:{t:pypl,abc:123,uu:777},//data : tpyplabc123uu777,dataType:json,success:function(json){console.log(json);for(vari0;ijson.length;i){$(#container).append(h1json[i].title/h1);}},error:function(xmlhttp,errorText){console.log(xmlhttp);console.log(errorText);if(xmlhttp.status405){alert(无效的请求方式);}elseif(xmlhttp.status405){alert(未找到URL资源);}elseif(xmlhttp.status500){alert(服务器内部错误请联系管理员);}else{alert(产生异常请联系管理员);}}})})/script