Question

I would like to use my own hash parameters in the URL, but when I do the jQuery Mobile site does not work any more. Just a blank white screen with an endless spinner. Is it true the hash is off limits to me when using jQuery Mobile?

Was it helpful?

Solution

If you need to pass parameters to internal/embedded page, jQuery Mobile does not support this feature. But there are two plugins that let you do so:

I advise you to read the official documentation on jQuery Mobile's Navigation Model: http://jquerymobile.com/demos/1.1.0/docs/pages/page-navmodel.html

The two plugins are mentioned in the "Known limitations" section.

OTHER TIPS

You'll have to disable the hashstate plugin. I'm not familiar with doing this but I think you can do this:

$(window).bind('hashchange', function (event) {
    event.stopImmediatePropagation();
});

Basically, jQuery Mobile listens to this event and transitions to a page when the event handler for this event fires.

Hash changes that occur independently of a click, such as when a user clicks the back button, are handled through the hashchange event, which is bound to the window object using Ben Alman's hashchange special event plugin (included in jQuery Mobile). When a hash change occurs (and also when the first page loads), the hashchange event handler will send the location.hash to the $.mobile.changePage() function, which in turn either loads or reveals the referenced page.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top