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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:26:55+00:00 2026-05-31T09:26:55+00:00

The following works, if I have something like this: return Json(new { CustomerInfo =

  • 0

The following works, if I have something like this:

  return Json(new { CustomerInfo = custinfo}); // defined in the controller

  // below I define in my client script
  jQuery.each(CustomerInfo, function () {
                 jQuery.each(this, function () {
                     // get field info from the object
                 });
             });

But, if I pass back 2 pieces of data as such

     return Json(new { CustomerInfo = custinfo, Message = msg });

Note that custinfo is a list and message is a string

In my .ajax() I have the following with retrieves information from the JSON

     function (data) {
        alert(data.Message); // show up fine

        alert(JSON.stringify(data.RepInfo));

       jQuery.each(data.CustomorInfo, function () {
          jQuery.each(this, function () {
              // get data for each field . Show up as undefined here for my row content
          });
       });

     } 

If I do alert on JSON.stringify on the above code I get get the following:

[{"ID":"12","Date":"01/23/2012","City":"Clearwater","State":"FL"},{"ID":"00017-LV01-12","Date":"02/09/2012","City":"Peoria","State":"IL"},{"ID":"00010-LV01-12","Date":"06/22/2012","City":"Newport Beach","State":"CA"}]

When I view the data wihin .each() it is pulling undefined for the row content.
How can I get it to show the content of the rows.

  • 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-31T09:26:56+00:00Added an answer on May 31, 2026 at 9:26 am

    you can try this:

           $.each(data.CustomorInfo,function(i) {
    
               $.each(this, function(key, value) {
                            alert(key +'='+ value);  
                    });
               });
    
            });
    

    live demo : http://jsfiddle.net/PQcFx/18/

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

Sidebar

Related Questions

I have a webservice function that returns something like the following: New Orleans, Louisiana
I have the following code which works perfectly fine, however I would like to
I have a script element in my webpage, something like this: <script id=myscript></script> Now,
I have something like the following: @RunWith(AllTestsRunner.class) public class AllTests { } in which
I have something like this HTML structure : <form name=myvalue id=hello> <input type=text name=name
I have something like this create function Answers_Index(@id int, @questionID int) returns int as
Let's say I have the class Foo . The following works fine: class Foo
I have the following which works in SQL Query Analyzer . select oh.* from
I have an understanding problem of how the following code works: XMLInputFactory xif =
I have following code which works for radio buttons but need to be changed

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.