jquery-----ajax的几种方法



$.get(url,function(data,status){ if(status == 'success'){ layer.msg(data,{shift:1,time:2000},function(){ location.reload(); }); }else{ layer.msg(data); } });

 1.//get方法提交,不需要带data参数,直接URL传入


$.ajax({ url:'/admin/category/sort', async:true, type:'post', data:data.field, dataType:'json', success:function(){ layer.msg('修改列表成功',{shift:1,time:2000},function () { location.reload(); }) } })

 2 //支持get post的提交

 

原文地址:https://www.cnblogs.com/dayin1/p/11551018.html