I've got a url like this:
http://www.site.com/234234234
I need to grab the Id after /
, so in this case 234234234
How can i do this easily?
See Question&Answers more detail:osI've got a url like this:
http://www.site.com/234234234
I need to grab the Id after /
, so in this case 234234234
How can i do this easily?
See Question&Answers more detail:osGet 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.