How to get the directory part of current URL in JavaScript?

前端 未结 6 682
生来不讨喜
生来不讨喜 2021-01-11 12:42

I\'m trying to add a \"back to dir\" button at the top of a web page, which would redirect the user to the same URL, but with no filename in it.

For example, clickin

6条回答
提交回复
热议问题