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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:53:25+00:00 2026-06-12T08:53:25+00:00

I am new to JQuery and Json and I am stumbled into some problem.

  • 0

I am new to JQuery and Json and I am stumbled into some problem. Appreciate it very much if anyone could offer me some help. My problem is as follow:

In my JSP, I have ajax call that will return me json object. I want to get the keys in my json object, find those tr in my table that its ID match with the the keys, and ultimately populate other column in that particular row with the value from my json object.

Here is my jquery ajax call

    $.ajax({
....
....
success:function(data) {    
//Data is a Json Object. The value is for example :{"A":"1","B":"2","C":"3"}    
for(key in data) {
    $("#myTable tr").find(key).find("td").eq(1).html(data[key]); // not working!
}
}
});

, I have the following html blocks:

<table id = "myTable">
    <tr id = "A">
      <td>Descriptopn.</td>
 <td>...</td> // I want to set this value to be 1
    </tr>

    <tr id = "B">
 <td>Description</td>
 <td>...</td> // I want to set this value to be 2
    </tr>

     <tr id = "C">
  <td>Description</td>
       <td>...</td> // I want to set this value to be 3
</tr>   
 </table> 

My problem is the above syntax is not working. Is there a way I can make this thing right? Thank you.

  • 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-12T08:53:26+00:00Added an answer on June 12, 2026 at 8:53 am

    Since you have the id (and it should be unique!), you can just use the following:-

    $('#' + key).find('td:eq(1)').text(data[key]);
    

    Here’s a fiddle

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

Sidebar

Related Questions

Hope some of you can help me. I am new into this json/jquery thing.
I am fairly new to jQuery and JSON and have run into a problem
I am very new into jQuery and JSON. I need to parse a JSON
I have a problem accessing JSON data. I'm new to JSON and jquery so
i'm very new to jQuery : I'm trying to render my JSON from a
I am very new in jquery and json.i know jsp and java in my
I'm new to jquery and JSON. I have the following JSON structure. { address:{
I'm quite new to the whole jQuery/JSON thing but thought I would give it
I'm very new to jQuery and i'm developing a plugin (for my own use)
I'm fairly new to jquery and working with json, so please bear with me.

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.