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 903779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:56:34+00:00 2026-05-15T15:56:34+00:00

I am playing with the 1.4.1 jquery.parseJSON method and looks like it would be

  • 0

I am playing with the 1.4.1 jquery.parseJSON method and looks like it would be a good fit for my project which is iterating over a JSON string that is loaded from C#. However, the JSON that gets loaded is an entity object and they have generic collections inside of them and thus creates the same name in the JSON string. For example:

This works because theres only item with a name all to itself:

var obj = jQuery.parseJSON('{\"ItemID\":1014470}');
alert(obj.ItemID);

This works but only gets the last item in the JSON string:

var obj = jQuery.parseJSON('{\"ItemID\":1014470,\"ItemID\":134564879898798}');
alert(obj.ItemID);

So I thought separating the JSON string as follows would solve it:

var obj = jQuery.parseJSON('{\"ItemID\":1014470},{\"ItemID\":134564879898798}');

Which of course does nothing

I was thinking that you could do something like this:

jQuery.each(obj, function(){
     // get each ItemID ???
});

Is there a better way to do something like this?

Currently we use these ugly javascript arrays with lots and lots of looping methods, I was hoping jQuery could provide a cleaner way of iterating over a JSON string.

  • 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-15T15:56:35+00:00Added an answer on May 15, 2026 at 3:56 pm

    To repeat items, you use an array. Either an array of objects:

    [{"ItemID":1014470},{"ItemID":134564879898798}]
    

    or an object that has an array as member:

    {"ItemID":[1014470,134564879898798]}
    

    The first one you can loop using:

    $.each(arr, function(){
      alert(this.ItemID);
    });
    

    The second you can loop using:

    $.each(obj.ItemID, function(){
      alert(this);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been playing with jQuery in an ASP.NET project and am finding some odd
So I have been playing with jQuery for a good time now and I'm
Using jQuery, can you show me the syntax for playing a sound? I would
What is a good place to start playing with jQuery, besides the jQuery website.
I just working with JSON data and am playing around with jQuery and Ajax
I was playing around with the jquery autogrow plugin, which expands the height of
I've been playing around with jQuery's parseJSON and simplejson and I can't seem to
I am playing around with parsing JSON in jQuery and I am having trouble.
I am playing around with jQuery and thought I would build a little css
I'm playing around with a jquery function called ghostType which basically types out text

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.