jquery:ajax()方法的标准写法

$.ajax({

  url:"https://www.baidu.com",//请求地址

  dataType:"xml",//数据类型(xml、html、script、text、json、jsonp)

  async:"true",//是否异步(false或者true;默认值为true)

  data:"{'键','值'}",//键值对的形式

  type:"GET",//请求格式GET和POST

  beforesend:function(){},

  success:function(){},

  complete:function(){},

  error:function(){},

})

posted on 2017-11-27 15:11  金翅鸟  阅读(304)  评论(0编辑  收藏  举报