Currently I am scraping the end of an url using javascript like so:
var url = document.URL;
var sale = url.substring(url.lastIndexOf('/') + 1);
if(sale != "")
So if there is this /sales/1234 it would pick it up, trouble is it still works for something else like sales/anotherword/1234, is there an easy way to adjust this to only pick up the number after "/sales/"?