Answers for "how to get the current pathname in javascript"

-1

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 "how to get the current pathname in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language