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