how set the jquery attr method display url and resource get page url code example Example: jquery get URL slug var pathname = window.location.pathname;