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

Posted 金翅鸟

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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(){},

})

以上是关于jquery:ajax()方法的标准写法的主要内容,如果未能解决你的问题,请参考以下文章