I am using jQuery. How do I get the path of the current URL and assign it to a variable?
Example URL:
http://localhost/menuname.de?foo=bar&nu
var path = location.pathname returns the path of the current URL (jQuery is not needed). The use of window.location is optional.
var path = location.pathname
window.location