No real header for programmatically popup?

No real header for programmatically popup?

Hello,
I want to programmatically open a popup but the header isn't shown properly, i.e. not centered and not with background:
  1. $("<div data-role='popup' data-overlay-theme='b' data-theme='c' class='ui-corner-all'><div data-role='header''><h3>My header</h3></div><div data-role='content' data-theme= 'd' class='ui-corner-bottom ui-content'>My Text</div></div>")
          .popup()
          .popup("open");

If I open an existing popup with header with .popup("open"); it will be shown but if I change it with $().html() and $().trigger('create'); also no correct header will be shown.

Thanks in advance for any help.