how to get last url in jquery demo online code example Example: jquery get URL slug var pathname = window.location.pathname;