I have included + and - to increment and decrement the quantity of a product in the cart page. Now i need to update it automatically without clicking the update shopping cart button. How can i do that? Kindly help me to fix this problem
1条回答 默认 最新
- doushi8599 2018-09-12 10:06关注
Use jQuery ajax() Method ajax function tutorial
<button type="button" name="button" id="button-minus"> - </button> <script> $(document).ready(function(){ var count = 0; $("#button-minus").click(function(){ if ( count > 0 ){ $.ajax({url: "url here", success: function(result){ $("#div").html(result); count--; }}); } }); }); </script>
解决 无用评论 打赏 举报