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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:17:39+00:00 2026-06-06T04:17:39+00:00

I am trying to return two json sets from java which each contain key/value

  • 0

I am trying to return two json sets from java which each contain key/value pairs. I can get the data to return as expected but once I have the data I can not access it properly. Here is what my data coming from the java looks like

{"RESULTS":
    {"MAP_1":
       [
         {"value":"1","display":"output text","type":"type a"},
         {"value":"2","display":"more output text","type":"type a"}
        ],
      "MAP_2":
        [
         {"value":"1","display":"output text","type":"type b"},
         {"value":"2","display":"more output text","type":"type b"}
         ]
     }
}

I have tried using $.map and $.each but I can not seem to drill into the data any help would be greatly appeciated.

Here is my latest attempt:

$.ajax({
    url: url,
    dataType: "text",
    data: {
         searchString: request.term
    },
    success: function( data ) {
        response( $.map( data.MAP_1, function( item ) {
            label: item.value + ", " + item.type
                value: item.display
        }));
    }
});

Thanks in advance!

  • 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-06-06T04:17:41+00:00Added an answer on June 6, 2026 at 4:17 am

    The format of the data returned by java is text, not json. So you should specify the dataType as json. In addition the following code are not right, I think.

    data.MAP_1
    

    should be

    data.RESULTS.MAP_1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to return two ref cursors from a procedure and having a bit
Iam trying to return json data from codeigniter view. but my code is not
Im trying to return the value that a $ajax call returns, from a function
I'm trying to get some json from an action but I have a problem.
I am trying to compare two vector objects, and return a single vector containing
I'm trying to create a method that will sum two timeO objects and return
I am trying to call showUpload(); from within two setTimeouts. Neither works. It seems
I'm working with the Wufoo api ( https://{subdomain}.wufoo.com/api/v3/forms/{formIdentifier}/entries.{xml|json} ) trying to get all of
I'm trying to create a page with two functional parts: a form which the
I am trying to make an ajax sending data in JSON from a partial

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.