Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6338713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:30:05+00:00 2026-05-24T19:30:05+00:00

What did I manage do do wrong here? I can’t see it, through the

  • 0

What did I manage do do wrong here? I can’t see it, through the first $.each it works, get to the second it stops..

var testJSON = {"cluster":[{"node":[{"name":"one", "number":'100', "error":"none"},{"name":"two", "number":'200', "error":"none"},{"name":"three", "number":'300', "error":"found"},{"name":"four", "number":'400', "error":"none"}]}]}

if (testJSON.cluster.length != 0)
{
    $.each(testJSON.cluster, function(i, clstr)
    {
        $('.clusters').append('<ul class="nodes">');
        $.each(clstr.node, function(i, ndes)
        {
            $.find('ul').append('<li>'+ndes.name+'</li>');
        });
        $('.clusters').append('</ul>');
    });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:30:06+00:00Added an answer on May 24, 2026 at 7:30 pm

    Change your code to the following:

    if (testJSON.cluster.length != 0) {
        $.each(testJSON.cluster, function(i, clstr) {
            $('.clusters').append('<ul class="nodes"></ul>');
            $.each(clstr.node, function(i, ndes) {
                $('.clusters ul.nodes').append('<li>' + ndes.name + '</li>');
            });;
        });
    }
    

    When you append an element, you don’t have to later append the closing tag. Also, find cannot be called directly from the jQuery object. You need a selector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

D:\zjm_code\basic_project>python manage.py syncdb Error: One or more models did not validate: topics.topic: Accessor for
Did anyone try to read programmatically an Alibre Design CAD file? I see that
EDIT: Managed to test it all and I guess my friend was wrong here,
I have went through a few links here, not all of them, regarding MKPinAnnotationView
This is my first question ever on StackOverflow, hurray! I can honestly say I
I cannot get translations to show up for my templates. Here is what I
I'm trying to figure out what I'm doing wrong here. Using autocomplete I'm getting
I managed (as you can see in older posts from me) to insert a
Did you ever have to choose between WISA or LAMP at the beginning of
Did you ever had a bug in your code, you could not resolve? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.