Response title
This is preview!




$.ajax() request and if there's something wrong with the response I shoot a popup. Something like this:<div data-role="popup" id="popup"> <p id="popupMsg"></p> </div> $("#popupMsg").html(msg); $("#popup").popup({ history:false, overlayTheme: "a" }).popup('open'); It all works fine, but If I change the popup to include a button, this way:
<div data-role="popup" id="popup"> <p id="popupMsg"></p> <a href="#" data-role="button" data-rel="back" data-theme="c">Ok</a> </div> Then the link is not styled, and it will just show an 'Ok' link. If I move the popup to a dialog then it all works, button and all, but since I want the page underneath to be seen, I'd like to keep it a popup.
div must go inside the page div, and not outside of it (as a dialog div would), like this:
Before (wrong):
<div data-role="page">
<div data-role="content">
...page stuff...
</div>
</div>
<div data-role="popup" id="popup">
<p id="popupMsg"></p>
<a href="#" data-role="button" data-rel="back" data-theme="c">Ok</a>
</div>
After (right):
<div data-role="page">
<div data-role="content">
...page stuff...
<div data-role="popup" id="popup">
<p id="popupMsg"></p>
<a href="#" data-role="button" data-rel="back" data-theme="c">Ok</a>
</div>
</div>
</div>
This wasn't all that clear in the docs...
Btw, I find this very annoying, because in my application I have two pages, and if I want to show the popup in both, I can't. I had to duplicate it changing id.
Having a way to keep it outside of pages (like dialogs) would be very welcome.
© 2012 jQuery Foundation
Sponsored by
and others.
