答案 0 :(得分:1)
尝试使用像这样的post
ajax请求 -
$.post("edit_brand.php",
{
brand_name : brand_name, brand_status : brand_status, id : id
},
function(data, status){
$('#'+id).children('td[data-target=brand_name]').text(brand_name);
if (brand_status == 1) {
$('#'+id).children("<span class='label label-success'>Available</span>");
} else {
$('#'+id).children("<span class='label label-danger'>Not Available</span>");
}
$('#modal-edit').modal('toggle');
});
答案 1 :(得分:0)
嗯,对于这一行,
$('#'+id).children('td[data-target=brand_status]').children("<span class='label label-success'>Available</span>");
你应该使用这个:
$('#'+id ).children('td[data-target=brand_status]').replaceWith( "<span class='label label-success'>Available</span>