I have this: I want this: how do i do this in javascript? I tried window.location.href but it is giving me whole url I tried window.location.pathname.substr(1) but it is giving me found-locations/ Answer Use location.pathname and location.search:
I have this: I want this: how do i do this in javascript? I tried window.location.href but it is giving me whole url I tried window.location.pathname.substr(1) but it is giving me found-locations/ Answer Use location.pathname and location.search: