I'm trying to refresh a listview in jQuery Mobile after a dynamic insert of LI elements in an UL.
Whenever I try $("#myUL").listview('refresh');, on the console I get the error:
Uncaught TypeError: $(...).listview is not a function
How can I solve this?
Make sure you include jquery before jquery.mobile in head
... src="lib/jquery-1.11.3.min.js"
... src="lib/jquery.mobile-1.4.5.min.js"
Check that the DOM is ready before doing refresh with:
$(document).ready(function(){
$('#playlist').listview('refresh');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With