Jquery mobile style not getting applied during ajax -
am trying load section of page using ajax in jquery mobile , append dom. styles of jquery mobile not getting applied.checked , found out there should .trigger('create') method should called. but, adding empty space.
am doing below thing.
$.ajax({ url : pagename, datatype : "html", success : function(data) { $("#score").html(data); $("#score").trigger("create"); } });
is there wrong in this. please help.
it not seem work. below structure after listview inserted dom <div id="newssection"> <ul data-role="listview"> <li class="load" data-icon="false"> <a id="newslink" rel="external" href="newsdetail.html"> <div class="ui-grid-a">abc</div> </a> </li> <li class="load" data-icon="false"> <a id="newslink" rel="external" href="newsdetail.html"> <div class="ui-grid-a">abc</div> </a> </li> </ul> <div class="footercontainer"> </div> </div>
credit goes @gajotres
use $('[data-role=lisview]').listview().listview('refresh')
.
$.ajax({ url : pagename, datatype : "html", success : function(data) { $("#score").html(data); $('[data-role=lisview]').listview().listview('refresh'); } });
Comments
Post a Comment