I have this tag in an example:
<button onclick="setLocation('http://mysite.com/checkout/cart/add/product/17/')" />
What I need to do is to initiate an ajax request when the button is clicked. I need the product / 17 url above added to my ajax url. Any smart ways to extract this without using regular expressions? HTML does not change - however, I can change the URL, in which case I will need to extract the exact URL from the onclick attribute.
So I need a URL or "product / 17" extracted from the onclick attribute, hopefully without using regular expressions.
thanks
source share