javascript - jquery append doesnt include bootstrap style after adding -
i have jquery script
$('.add-item').on('click',function(){ var url = '{% url "main:adding_from_all_products" %}'; var $this = $(this); var product_add_name = $this.data('item-name'); $.post(url,{'product_add_name':product_add_name},function(response){ $(".test").append('<p class="product-item">'+ '<span class="product-width-fix">' + response + '<a href="#" data-product-id=' + product_add_name + 'class="btn btn-mini btn-success remove-product">remove</a></span></p>'); }) return true; });
the element add button styled bootstrap. after append done
<a href="#" data-product-id=' + product_add_name + 'class="btn btn-mini btn-success remove-product">remove</a></span></p>
the button not apper, it's link withouth style. should ?
maybe need ""
product_add_name
:
$(".test").append('<p class="product-item">'+ '<span class="product-width-fix">' + response + '<a href="#" data-product-id="' + product_add_name + '" class="btn btn-mini btn-success remove-product">remove</a></span></p>');
Comments
Post a Comment