js拼装html无法触发事件

来源:互联网 发布:南财网络教育平台 编辑:程序博客网 时间:2024/05/29 09:53
$("body").delegate('.refund','click',function(){//主要是这里            var truthBeTold = confirm("退款审核,审核结果会在24小时内,通过微信公众号渠道发送,请注意查收!");             balance_rule_id = $(this).data('id');            this_refund = $(this);            if (truthBeTold) {                 $.post("{:url('')}",{balance_record_id:$(this).data('id')},function(result){                    console.log();                    if(result == 1){                        $("#status"+balance_rule_id).text("退款审核");                        this_refund.remove();                        alert("发起审核成功!");                    }else if(result == -2){                        alert("正在审核...");                    }else if(result == -1){                        alert("发起审核失败!");                    }else{                        alert("网络异常");                    }                 });            }        });
原创粉丝点击