buttons not styled in jQM popup launched from code

buttons not styled in jQM popup launched from code

I posted this question on SO too, but probably this is a better place to get an answer.

I'm using jQM popup to 'alert' users of something. For example, I make a $.ajax() request and if there's something wrong with the response I shoot a popup. Something like this:

  1. <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:

  1. <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.

Am I missing something? I saw a lot of questions about popups/dialogs, but they all refer to clicking a button to show them. I use jquery-1.8.2 and jquery.mobile-1.2.0.