i want to append data in "li" getting from web method. currently data is showing in listitem but it appends complete data in single "li".
for example if dataset returns 3 rows it appends all 3 rows in single listiem. but i want to append each row in each listitem.i know it will be done by iteration but i tried unforunately it did not work.
here is my jquery code
<script>
$('.show_hide').live("click", function (event) {
event.preventDefault();
$(".notification-counter").add();
$('#wrapper').toggle(550);
$(".notification-counter").remove();
sendData();
function sendData() {
$("#thelist").html('');
$.ajax(
{
type: "POST",
url: "Notification.aspx/GetCustomers",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "true",
cache: "false",
success: function (msg) {
$("#thelist").html('');
$.each(msg, function (key, value) {
$("#thelist").append("<li>" + key + ": " +value+ "</li>");
});
},
Error: function (x, e) {
alert("Some error");
}
});
}
});
</script>