jquery to capture url on load and code example Example: jquery get URL slug var pathname = window.location.pathname;