JQuery Mobile Loses All Styles After Navigating Pages JQuery Mobile Loses All Styles After Navigating Pages ajax ajax

JQuery Mobile Loses All Styles After Navigating Pages


This has been solving all of my problems.

$('...').trigger('create');

You just have to find the right element to put in the selector.

For me, these lines did the trick:

$(document).bind('pagechange', function() {  $('.ui-page-active .ui-listview').listview('refresh');  $('.ui-page-active :jqmData(role=content)').trigger('create');});


Placing listview('refresh') after changing the page solved my problem.

$.mobile.changePage("#catalog");$('#list_included_in_catalog_page').listview('refresh');


instead of

success: function (msg) {    $("#garageList").html(msg.d);    $.mobile.changePage("#garageList");} 

Do

success: function (msg) {    $("#abc").html("<ul data-role='listview' id='xyz' data-filter='true' data-filter-theme='a' data-filter-placeholder='search name or account no...' data-split-icon='info' data-split-theme='a'> " + msg.d + "<ul>");    $.mobile.changePage("#garageList");    $("#abc").find(":jqmData(role=listview)").listview();}