JQM Button rendering after dynamic page injection

JQM Button rendering after dynamic page injection

I have some problems with the dynamic page injection if JQM. I replace the content and header and refresh the page. But the formatting of my Buttons is lost. Also the listview at the content area looks not well formatted. Do anybody know how to fix that. I tried it by $page.button(), but this will render my whole page as button.

  1. var $page = $(this.element); var content = $page.children(":jqmData(role=content)"); var header = $page.children(":jqmData(role=header)"); content.html(this.view); header.html(this.header); $page.page(); $page.button("refresh",true); $.mobile.changePage($page, options);

JQM Version 1.2.0 JQuery Version 1.7.1