Reputation: 784
Base assigned in html like this:
<base href="http://root/tempop/panel/"/>
Current browser URL is:
http://root/tempop/panel/about/1
And i want this:
about/1
How can i get?
Upvotes: 0
Views: 285
Reputation: 497
var base = $("base").prop("href");
var fullurl = "http://root/tempop/panel/about/1"
var path = fullurl.replace(base,"");
console.log(path)
Upvotes: 1
Reputation: 9690
var endPiece = document.location.href.split('http://root/tempop/panel/')[1];
Upvotes: 1