How to click a link that will execute but not redirect.
问题 I have a few products in a mySQL database whose links are being retrieved in my script with $producturl. These url's actually add the product to the cart (http://www.example.com/cart/?add-to-cart=1127). I am trying to create a script that will allow the user to add products to the cart but NOT redirect them, just execute the link so the user stays on the same page. I am using preventDefault and stopPropgation but it is not working. The alert shows up but the link itself is not executing when