October 2017
Intermediate to advanced
370 pages
8h 57m
English
There's a small catch in our solution: amp-list will only fetch new URLs. Let's say we decide to remove a product with ID product1. The URL would end up like this: cart.php?del=product1. This will remove the product with ID product1 from the cart. Suppose then that we add product1 back into the cart, and try to remove it again. Then the URL hasn't actually changed, so amp-list won't fetch the URL again and the product won't be removed.
To deal with this situation, we can add a random number to the end of the URL, so that the URL will be unique and amp-list will perform the fetch. Luckily, amp-bind gives us a way to achieve this with the random() function.
First, we'll need to update the URL to append ...
Read now
Unlock full access