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

  • Home
  • SEARCH
  • 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 and I've run myself into a time problem. I've
Recently I have started playing with jQuery, and have been following a couple of
I'm playing around with writing a jQuery plugin that uses an attribute to define
While playing around with regexps in Scala I wrote something like this: scala> val
I'm playing with jQuery, and I want to fade out the logo. So basically,
I've been playing with jQuery today, and I want to know if I can
I've just start playing about with jQuery and want to place the results of
I am using JQuery. I am having below jquery which I am using to
Playing with log4net, I have seen the possibility to use a per-thread stack of
Just playing around with the now released Silverlight 2.0. I'm trying to put a

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.