After reading through all the comments, none of the suggested solutions seem to do the trick for me. My issue involves a piece of Jquery code that retrieves content from an external PHP script and updates a div in my application. However, once the new data is loaded, it lacks the Jquery Mobile styling. I've tried using .page() and trigger("refresh"), but nothing seems to refresh the entire div successfully. Here's the relevant part of my code:
function getcontent(pg) {
$("xyz").html("");
$.get("http://myscript.php", function(data) {
$("#xyz").html(data);
$("#xyz").page();
}
The HTML in question:
<div id="xyz"></div>
I'm really struggling to find a solution here. I did manage to make some progress by removing the wrapper div ("xyz") and refreshing individual elements like listviews and buttons, but that approach feels quite clumsy.