showing results for - "get last path segment of url in javascript"
Luca
19 Oct 2018
1const last_segment = window.location.pathname.split('/').pop();
Erica
17 Nov 2020
1console.log(this.href.substring(this.href.lastIndexOf('/') + 1));
2
queries leading to this page
get url last word jqueryjavascript get the last part of a urlget last segment of urlhow to get last string from url in javascriptget last location javascriptget the last url section javascriptjavascript window href get last segmentget last part of uri or url javascriptget last string from url in javascriptjavascript get last url pathnamejavascript get last path in urljavascript get last item in urljavascript get last url segmentget last url segment in javascriptjavascript get last part of urljquery get last part of href in anchor linkget last url javascriptjs get last url segmentjavascript get last segment of urlget last all urlsjquery match with anchor href last parthow to get last segment from url in javascriptget url last segment javascripthow to get last 2f from window location pathnameget the last parth of url jsget last string from urljavascript get last segment of current urllocation pathname lastindexofcheck last of url jswindow location pathname substring 28window location pathname lastindexof 28 27 2f 27 29 29get last path segment of url in javascriptget last url segment javascriptget last part of url javascriptget last part of url in jquery without hashhow to get last part of url in javascriptget last two of url javascriptsplit url last jasvascriptjs get last part of urlhow to get the last segment of the url in javascriptjquery get current url last segmentget last segment in urlget last part of uri or url that start with 23 hash jqueryget last part urlget last parameter url javascriptget last page url in jsjavascript last url segmentangular get last part of urljs get last 2f of urlget last segment of url javascriptjavascript path last componentexpress get last part of urlget last element from an url jshow to get last before value in url using javascriptget the last part of url in javascriptjquery get last url segmentget last path segment of url in javascript