Do more with
var segments = location.pathname.split(/\//); // the first item in the array will be an empty string
console.log(segments[2]);
console.log(segments[segments.length-1]);
https://developer.mozilla.org/en-US/docs/Web/API/Location
Premium Content
You need an Expert Office subscription to comment.Start Free Trial