css类不在append中工作但在html中工作

时间:2018-04-16 10:17:00

标签: php jquery css

$.ajax({
    type: "POST",
    async: true,
    url: "<?php echo base_url(); ?>" + "index.php/admin/get_user_privilages",
    dataType: 'json',
    data: {user_id: user_id},
    success: function (res) {
    var iHtml = '';
    $.each(res, function(key, value) {
        iHtml += '<div class="col-md-6">' +
    '<div class="checbox-wrapper">' +
    '<div class="checbox-wrapper-heading">' +
    '<h5>' + value.category_name + '</h5>' +
    '</div>' +
    '<div class="checbox-wrapper-label">';
    $.each(value.sub_cat, function(key2, value2) {
    iHtml +=
      '<label> <input type="checkbox" onchange="change_privilages('+key2+','+user_id+')" '+value.check[key2]+' class="i-checks"> &nbsp;' +
      value.sub_cat[key2] + '</label>';
    });

     iHtml += '</div>' +
    '</div>' +
    '</div>';
    });


    $('#image_view_panel').empty().append(iHtml);

0 个答案:

没有答案