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