美文网首页
jq中的ajax

jq中的ajax

作者: 焚心123 | 来源:发表于2020-01-12 16:36 被阅读0次
  • $.ajax()
    $.ajax({
            url:' 路径 ',//-->读取数据的地址/路径
            type:' get/post',//--->传输的方式
            async:true,//--->是否异步
            success:function(res){
                //---->数据读取成功后,返回的数据
            },error:function(msg){
                    //--->失败后,返回 的数据
            }
      })
  • $.get()
      $.get(' url ' , {} ,function(ret){} ,' json ')
  • $.post()
     $.post(' url ' , {} ,function(ret){} ,' json ')
  • $.getJSON()
$.getJSON(' url ' , function(ret){} )

相关文章

网友评论

      本文标题:jq中的ajax

      本文链接:https://www.haomeiwen.com/subject/huxwactx.html