ajax请求数据get、post
时间:2020-06-26 17:28:54
收藏:0
阅读:51
ajax请求数据get、post
post请求案例
$.ajax({ type:"post" , url:"请求地址" , data:{‘username‘:username,‘password‘:password} , contentType:‘application/json‘, success:function(res){ if(res.code == 200){ } }, error:function(){ csonsole.log(‘请求出错‘) } }
get请求
$.ajax({ type:"get", url:"链接地址", success:function(res){ if(res.code == 200){ alert(res.message) } }, error:function(){ console.log(‘请求出错‘) } })
有问题,请加群讨论:854184700
原文:https://www.cnblogs.com/yaosusu/p/13195417.html
评论(0)