I’m building a web app for Sign In / Registration etc, and do not want the page to have to refresh.
I know how to set a hash on the URL without refreshing the page:
location.hash
to give: http://www.mysite.com/#signin
But what I want: http://www.mysite.com/signin
Without the hash so it’s SEO friendly. Also, once I set that. How in JavaScript can I read the first path after the / so I can detect SignIn, Register,AboutUs etc, and show the appropriate content?
Thanks!
This will refresh the page. There’s no way around it without using an anchor (hash).
Then to read the page you’re on: