Answers for "js get path from url"

7

javascript get url path

window.location.pathname
Posted by: Guest on June-06-2020
0

javascript to get uri

var newURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname + window.location.search
Posted by: Guest on December-11-2020
0

js get path from url

var reg = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/;
var pathname = reg.exec( 'http://www.somedomain.com/account/search?filter=a#top' )[1];
Posted by: Guest on April-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language