2015. február 2., hétfő

dynamically created element in JQuery Mobile (does not apply styles after dynamically adding content)

I added <li> elements in <ul> with JQuery.


$(‘ul’).append(“<li>…</li>”);


First the <li> elements didn’t appear in<ul>


I found the solution here: http://stackoverflow.com/questions/7999436/jquery-mobile-does-not-apply-styles-after-dynamically-adding-content


I had to add this row:


$(‘ul’).listview(‘refresh’);


 


 



dynamically created element in JQuery Mobile (does not apply styles after dynamically adding content)