SyntaxFix
Write A Post
Hire A Developer
Questions
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.