Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
How to bind text to the label which is in JsonObj using jquery

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

code

image2

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>');
        });
    }
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

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
}
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!