Get ID from URL with jQuery
Get a substring after the last index of /
.
var url = 'http://www.site.com/234234234';
var id = url.substring(url.lastIndexOf('/') + 1);
alert(id); // 234234234
It's just basic JavaScript, no jQuery involved.
var url = window.location.pathname;
var id = url.substring(url.lastIndexOf('/') + 1);