frequent
frequent

Reputation: 28503

how to remove the hashtag from the URL in Jquery Mobile?

Just wondering:

I need to update the URL and remove all hashtag parameters before/after transitioning to a new Jquery mobile page.

Right now I'm trying like this, but it does not work:

$(document).on('pagebeforeshow', 'div:jqmData(role="page")', function(event, data){     

   var documentUrl = $.mobile.path.parseUrl( location.href );
   // update path and history
   $.mobile.path.set( documentUrl.hrefNoHash ); 

});

Is this possible at all? If so, how can I do it correctly?

Thanks for help!

Upvotes: 0

Views: 1658

Answers (1)

Vinay Revankar
Vinay Revankar

Reputation: 832

You can turn hashing off when you try changing the page. Hope this code helps.

Example:

$.mobile.changePage("#About", {transition: "slide",reverse: true,changeHash: false});

Upvotes: 1

Related Questions