Skip to content Skip to sidebar Skip to footer

How To Prevent Stacking The URL Of Chained Dialogs In JQuery Mobile

When you chain dialog boxes in jQuery Mobile there are these '&ui-state=dialog&ui-state=dialog...' strings stacked on the URL. Is there a way to prevent this? Thnx!

Solution 1:

  • What you can try is to add rel=external to the links which open the dialogs.
    This attribute will disable the Ajax navigation and should prevent stacking the URL.

  • You could also try the pushState plugin:

There is an optional feature that converts the longer, hash-based URLs mentioned in the previous section into the full document path which is cleaner and makes the Ajax tracking transparent in the URL structure. This is built as an enhancement on top of the hash-based URL system for Ajax links. Note that despite the name, this feature technically converts hash-based URLs by using history.replaceState (not history.pushState) in the current release because this works more reliably across our target platforms. For browsers that do not support history.replaceState, or if this feature is disabled, hash-based URLs will be used instead.

Since the plugin initializes when the DOM is fully loaded you can enable and disable it manually by setting $.mobile.pushStateEnabled global configuration option to false anytime before document ready.

You can check the online doc for more information:

http://jquerymobile.com/demos/1.2.0/docs/pages/page-navmodel.html


Post a Comment for "How To Prevent Stacking The URL Of Chained Dialogs In JQuery Mobile"