I am loading the jQueryMobile dialog using this code:
<a data-rel="dialog" href="/path/to/dialog?arg1=val1" data-theme="b" id="deleteButton" class="ui-btn-right home" data-direction="reverse" data-transition="slidedown">Delete</a>
There are two buttons in my dialog:
<a data-role="button" href="/path/to/page/that/showed/dialog" id="deleteAddressButton" data-rel="back">Delete</a> <a data-role="button" data-theme="a" href="/path/to/page/that/showed/dialog" data-rel="back">Cancel</a>
When I click the buttons, the dialog closes and returns to the page that opened the dialog. However, the page that opens the dialogs reloads through ajax, which seems unnecessary and violates everything. Does anyone know why this is happening? Should the dialog just close without reloading the calling page?
Note. The calling page only reloads if I initially go to another page, for example:
Homepage β Dialog Page β Dialogue
The problem occurs when I first go to the home page and then to the page that brings up the dialog. If I do a full reload of the page on the page that invokes the dialog, and then open and close the dialog, the page that invokes the dialog will not be reloaded through ajax.
Edit: this also happens on the jQuery Mobile documentation site. To see this:
- Go to http://jquerymobile.com/demos/1.0.1/
- Go to Pages and Dialogs
- Go to the "Dialogs" section
- Click on the first button "Open dialog".
- Use Firebug or something similar to viewing Ajax calls.
- Close the dialog with any button.
- Note that Ajax calls are launched to reload the calling page.
offex source share