jquery get absolutepath for current page code example Example: jquery get URL slug var pathname = window.location.pathname;