jQuery,用delimete(,)拆分,使用,转换为数组,获取值,但如何分配特定的选择器ID。?
$(document).on('click', '.update', function() {
var id = $(this).attr("id");
$.ajax({
url: "<?php echo base_url(); ?>HomeController/permission_fetch_getbyid",
method: "POST",
data: {
id: id
},
data: {
id: id
},
dataType: "json",
success: function(data) {
var chk_access = data.access;
arr_chk = chk_access.split(",");
<!---console["M1", "M2", "M3", "U1"]--!>
if (data.arr_chk == 'M1') {
alert('success');
}
$('#id').val(id);
}
})
});