I need to grab only the value 60408571 from the following url:
http://www.domain.com/ProductDetail.aspx?ProductId=60408571&this-is-a-page-title-that-goes-here
So far, I've successfully been able to grab everything after ?ProductId=
, but this returns:
60408571&this-is-a-page-title-that-goes-here
The JavaScript I'm currently using is:
if(window.location.href.indexOf("ProductId") > -1) {
s.prop14 = window.location.search.replace("?ProductId=", "");
}
I only want to grab the numerical value if the page the user is on is a page with ProductId in the url.
Thank you for your help.