When I need to get URL without the file's name , for example:
instead of
http://contoso.com/pages/test.aspx
I need
http://contoso.com/pages/
I use this script (with regex pattern "/^(http.+\/)[^\/]+$/"):
location.href.match( /^(http.+\/)[^\/]+$/ )[1]
No comments:
Post a Comment