Here’s my problem: I have many differents “pages” in one big HTML page and I just do transitions between them. My problem is that I generate dynamically some of the pages (including the “basket” page, and the other next page, which is the “reservation” page, which is constructed through an AJAX call).
All jQuery mobile pages are with a ‘#‘ in the URL so the URL doesn’t change and there’s no need to load a different URL.
So, to simplify things (I don’t know if it’s the best way), when the page is refreshed and there’s a ‘#‘ in the URL, I just want to make a redirection to the same URL without the ‘#‘ in it.
How would you do this?
# is (unofficially) called hash tag and for example #page is hash after the url.
You can get the hash with JavaScript like
window.location.hash, and to remove it you can just dowindow.location.hash = ""So whenever user is redirected to #page, you could remove the hash with the method above.
JQuery Mobile has
$.mobile.changePage("#page"), using it, I believe it won’t change the URL. I haven’t used jQuery Mobile though, so I could be wrong.