I'm using jquery mobile to building a site but when I click on a button and this button points to a dialog page, in the URL appears #&ui-state=dialog
. If I put in the <a data-ajax="false"></a>
the url is correct without #&ui-state=dialog
but the dialog window doesn't show correctly because obviously ajax is disable.there is some way to fix it?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
When you open the dialog, use
$.mobile.changePage()
and set thechangeHash
option tofalse
: http://jquerymobile.com/demos/1.0.1/docs/api/methods.htmlTry to use data-history="false" in the popup div tag like:
Good luck! :-)
Using
changeHash
would disable the change of history because the url won't change. So if the user clicks/taps the close button , it would propagate to the previous page if there was any.Also it might cause a problem when the user taps the back button on the mobile since there was no history change when the popup was opened, it would again take the user back to the previous page rather than closing the popup, which would be incorrect behaviour.
Instead of
changeHash
if we usetransition
it would work like a dialog and let the hash change the history too.@Vincentp have you tried removing the
changeHash
property from the 'changePage' call, now that you are usingtransition
?Don't know why, but Jasper example doesn't work when I try integrating it too.
I was using
data-*
attributes on the button for configuring the dialog box.Now I declare all the options in the
changePage
function, and it works fine.