Jquery - POST, success callback is not getting executed
问题 I am using the below Jquery code to add items to cart. My intention is to change the "Add to cart" button once the Ajax call is success. However its not happening. Code is below - jQuery.post('/cart/add.js', { quantity: 1, id: variant_id }, function(data){ var myelem = document.getElementById('red') ; if (myelem != null){ document.getElementById('red').id = 'normal'; } $("span").removeClass("hidden-count"); $(".cart-count").text('1'); $("#AddToCartText").text("Added"); $("#AddToCart").css(