While trying to order The C++ Programming Language ebook, I ended up finding a bug on Amazon.com
I just thought this was funny. I was trying to order the book and my payment method was messed up. So naturally it said I needed to update my payment method. When I tried to do this, it just didn't work. It would just keep setting it back to the previous method. I was getting frustrated after a few tries and decided I'd investigate the code a bit.
This javascript is important:
var radios = jQuery("input[type='radio']");
var clickedElem = radios.filter(":checked");
var selectedPaymentMethod = clickedElem.val();
I set some break points and realized that clickedElem was getting an array back from the radios.filter(":checked"). It should be a single element based on the next line. So I started looking through the elements on the page for other checked radios. The problem stemmed from the Amazon Associates SiteStripe bar at the top of the page. It had radios with "checked" as an attribute.
I disabled the SiteStripe, and sure enough, I was able to change the payment method properly.
I reported the bug and the cause. I just thought it was funny that all this happened while I was trying to order a programming book.
Posted Jul 25, 2016, 2:13 AM UTC