I am getting data in an array which I need to bind to the label below is my code. When the array is empty I need to bind no records found which are working but I need to bind the data in the array to the label. Suppose if I have 2 items in the array I need to bind two items i.e slider 1 should have one item and again after sliding to the right I need to bind the second item.
If more than 1 item is there then the right slider should be enabled and if it has only 1 item right slider should be disabled if there are no items both the sliders should be disabled


success: function (response) {
var json = response.d;
if (json.length == 0) {
$('.swiper-wrapper').append('<div class="swiper-slide">No rocords found</div>');
} else {
$.each(json, function (index, item) {
$('.swiper-wrapper').append('<div class="swiper-slide">Name : ' + item.Name + '<br />Number: ' + item.Number + '</div>');
});
}
You could throw a bunch of if else statements
if(length > 1) {
// there is more than one item
} else if(length < 1) {
// there is less than one item
else {
//there is exactly one item
}