Using window.location to get current path.