nich nich - 8 months ago 67
Javascript Question

How to disable #hashtag in URL

My JQM includes three


The issue:

Now I go to another page2 from the default home page1, so the URL is
. When I refresh the page, it is still in page2.

Is that a way that it can go back to
instead of current page (without any parameters)?


To disable updating URL with #hashtag, change default of changePage which handles pages transition before loading jQuery Mobile script in <head>.

Demo: #Hashtag (Disabled / Enabled)

 <link rel="stylesheet" href="" />
 <script src=""></script>
    $(document).on("mobileinit", function(){
     $.mobile.changePage.defaults.changeHash = false;
 <script src=""></script>