Use Jquery to amend a url - replacing a slash ('/') with a hash ('#')
Permalink
More of a jQuery issue, than a C5 one - but...
I'm making a section of a site has a long scroll page. It is using a page list to show multiple pieces of content on a single page. I need to amend the URLs being used in one part of the navigation to do 2 things:
- Remove final trailing slash
- Replace second to last slash with a hash - i.e: '#'
eg:
What I have:
mysite.com/about/stuff-we-do/
What I want:
mysite.com/about#stuff-we-do
Can anyone suggest a tidy jQuery function to do this? I'm sure it's straightforward, but am currently hitting a brick wall.
Thanks.
I'm making a section of a site has a long scroll page. It is using a page list to show multiple pieces of content on a single page. I need to amend the URLs being used in one part of the navigation to do 2 things:
- Remove final trailing slash
- Replace second to last slash with a hash - i.e: '#'
eg:
What I have:
mysite.com/about/stuff-we-do/
What I want:
mysite.com/about#stuff-we-do
Can anyone suggest a tidy jQuery function to do this? I'm sure it's straightforward, but am currently hitting a brick wall.
Thanks.