This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Display a themed modal alert #1012
Closed
Description
I'd like some way to display a modal alert using JQuery Mobile.
I don't know if there is an issue for it but I found a forum post here asking for the same feature - http://forum.jquery.com/topic/alert-modal-component
Activity
toddparker commentedon Mar 14, 2011
Good idea, added as a feature request here:
https://github.com/jquery/jquery-mobile/wiki/Feature-Requests
mrextreme commentedon Mar 28, 2013
I needed (well, wanted) this feature myself for the project I am working on. Here is what I came up with. It is not a jQM widget (yet), but I am looking into doing that. It simply uses the popup widget, so the chaining issues do apply on it. Also uses the button widget.
It's a quick solution to a simple problem, so please look at it as such. I hope it helps.
The most basic call is jqmAlert( messageString ); However, it accepts a second argument, which must be an object. In that object you can overwrite your default settings. But maybe most importantly, you can pass a callback function (buttonAction) to be called when the user hits the OK button.