Get a substring after the last index of /
.
var url="http://www.site.com/234234234";
var id = url.substring(url.lastIndexOf("https://stackoverflow.com/") + 1);
alert(id); // 234234234
It’s just basic JavaScript, no jQuery involved.
Get a substring after the last index of /
.
var url="http://www.site.com/234234234";
var id = url.substring(url.lastIndexOf("https://stackoverflow.com/") + 1);
alert(id); // 234234234
It’s just basic JavaScript, no jQuery involved.