评论

收藏

[jQuery] ajax jquery return没有返回值

开发技术 开发技术 发布于:2021-08-06 13:22 | 阅读数:239 | 评论:0

错误写法:
function editdivisionmember(division_id,users_id){
  $.ajax({
      type:"POST",
      url:"/default/index/ajax/do/editdivisionmember",
      data:"division_id="+division_id+"&users_id="+users_id,
      success:function(response){
        return response;
      }
    });
}
正确写法:
function deldivisionmember(divisionmember_id){
  $.ajax({
      type:"POST",
      async:false, 
      url:"/default/index/ajax/do/deldivisionmember",
      data:"divisionmember_id="+divisionmember_id,
      success:function(response){
         res = response;
      }
    });
  return res;
}


关注下面的标签,发现更多相似文章