我正在使用jQuery。如何获取当前URL的路径并将其分配给一个变量?
示例URL:
示例URL:
http://localhost/menuname.de?foo=bar&number=0
http://localhost/menuname.de?foo=bar&number=0
// get current URL
$(location).attr('href');
var pathname = window.location.pathname;
alert(window.location);
var CurrentBrowseurl = document.location.href;
console.log(CurrentBrowseurl);
let myUrl = ''+location
console.log(myUrl);