oookli
2/9/2015 - 3:04 PM

Use window.location.pathname. This gives you the path relative to the host. See here for more details. For any arbitary URL, assuming that t

Use window.location.pathname. This gives you the path relative to the host. See here for more details. For any arbitary URL, assuming that the variable url contains your URL, you can do:

url = url.replace(/^.*\/\/[^\/]+/, '')