Holen Sie sich das letzte Pfadsegment der URL in JavaScript
const last_segment = window.location.pathname.split('/').pop();
Anxious Alligator
const last_segment = window.location.pathname.split('/').pop();
console.log(this.href.substring(this.href.lastIndexOf('/') + 1));