I am using Ajax to load an xml and shape it into a jQuery Mobile listview. Right after sending the xml i am calling the trigger method so that the page can be re-initialized and the css styles can be added to the listview like so:
xmlhttp.send();
$("#page1").trigger( "create" );
When i load the page, i see the styles on the listview for a fraction of a second but then the listview shows up without the jQuery Mobile styles. It seems to work when i use a delay though like so:
setTimeout(function(){
$("#page1").trigger( "create" );
}, 5);
I noticed this as it always seemed to work when i used a breakpoint. This bothers me though, because when i use this method i always see the unthemed list for a short while. I also tried refreshing the list right before and after creation but none seemed to work. Does anyone know a way to fix this issue?