I am working on cordova app .I want to create list items using jquery . here is my html code :
<div class="body" id="list">
<ul class="list list-messages" id="list">
</ul>
</div>
And this is my js code :
<script>
$(document).ready(function () {
$(".navbar-title").html(localStorage.getItem("Provider"));
$.ajax({
type: 'Get',
url: 'http://41.128.183.109:9090/api/data/getalllocations',
success: function (data) {
for (var i = 0; i < 11; i++) {
$("#list").append('<li class="list-message" data-ix="list-item"><a class="w-clearfix w-inline-block" href="chat.html" data-load="1"><div class="w-clearfix column-left"><div class="image-message"><img src="images/128.jpg"></div></div><div class="column-right"><div class="message-title">James White</div><div class="message-text">Hey dude! We are waiting for you at the main station, we will meet you near to....</div></div></a></li>');
}
}
});
});
</script>
Its not working . please advice
appendinstead ofhtml()innerHtmlis a javascriptproperty. and it gives html value and you can set html value. But for pushinghtmlyou can useappendofjQuery