//设置为默认收货地址
$(document).on('tap','.right_none',function(){
    var _this = $(this);                //只有这样定义,在ajax的内部才可以调用this  
    var id = $(this).data('id');
    api.set_default({
        uid : _user.id,
        id  : id
    },function(data){
        if(data.errno){
            alert(data.errdesc);
            return false;
        }else{
            $('.main_bottom').find('div:first-child').removeClass('right');
            $('.main_bottom').find('div:first-child').addClass('right_none');
            _this.removeClass('right_none');
            _this.addClass('right');              //ajax 中操作this,需要先在ajax的外面给this重新定义为_this!!
        }
    },function(){
        alert("网络错误");
        return false;
    });
});

  

相关文章:

  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-01-05
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-11-18
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案