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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:36:09+00:00 2026-06-13T15:36:09+00:00

I have a problem with javascript, im calling an ajax method that returns this

  • 0

I have a problem with javascript, im calling an ajax method that returns this string:

{
  "ObjectResponse": {
    "Operation": "OK",
    "Response": "SUCCESS",
    "Message": "List of AAA Found",
    "List": [
      {
        "keySource": "gat\/images\/images_set\/apple.jpg",
        "idSiteKey": "1",
        "text": "Apple"
      },
      {
        "keySource": "gat\/images\/images_set\/cat.jpg",
        "idSiteKey": "2",
        "text": "Cat"
      },
      {
        "keySource": "gat\/images\/images_set\/coffee.jpg",
        "idSiteKey": "3",
        "text": "Coffee"
      },
      {
        "keySource": "gat\/images\/images_set\/dog.jpg",
        "idSiteKey": "4",
        "text": "Dog"
      },
      {
        "keySource": "gat\/images\/images_set\/horse.jpg",
        "idSiteKey": "5",
        "text": "Horse"
      },
      {
        "keySource": "gat\/images\/images_set\/police.jpg",
        "idSiteKey": "6",
        "text": "Police"
      },
      {
        "keySource": "gat\/images\/images_set\/tree.jpg",
        "idSiteKey": "7",
        "text": "Tree"
      }
    ]
  }
}

I assing the content in this way:

xhr.onreadystatechange = ensureReadiness; 
....
responseText = xhr.responseText;

If i try to parse it on javascript with:

response = JSON.parse(responseText);

if I acces a property such response.ObjectResponse.Operation I do get the right content.. but when I try to access the List it allways brakes

and if I try the same String but instead of calling the service I assign the content to a var it works I do can access the List

var myTemporalString ='{"ObjectResponse":{"Operation":"OK","Response":"SUCCESS","Message":"List of Keys Found","List":...';
response.JSON.parse(myTemporalString);

Any suggestion why this could be happening?

  • 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-13T15:36:10+00:00Added an answer on June 13, 2026 at 3:36 pm

    You can try this way,

        xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4) {
                        if (xhr.status == 200) {
    
                            try{
                                    var mJsonData = JSON.parse(xhr.responseText);
                                }catch(err){
                                    console.log(err);
                                    alert(err);
                                    return;
                                }
    
                            for(i=0;i<jsondata.ObjectResponse.List.length;i++){
                                       console.log(jsondata.ObjectResponse.List[i].text);
                                     console.log(jsondata.ObjectResponse.List[i].keySource);
                                       console.log(jsondata.ObjectResponse.List[i]. idSiteKey);
                               }
    
                  }
               }
           }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple page that returns an ajax success/error message on submission. The
I have a problem with a javascript set of functions that I made. This
I have a problem with JavaScript magic. When I execute this code: var page
I have a problem with Javascript that keeps bugging me for quite a while
Hi I have a problem with a javascript string var foo = \<a href=javascript(foo('a','b'))>test</a>\
this problem is driving me crazy... I'm calling a PHP file through Ajax and
I have a problem with my javascript code. I have this prototype and I
My problem is that all JavaScript that I apply to an ajax-loaded JqueryUI Dialog
I have problem with javascript code. I am using google maps and I am
I have one problem with Javascript Nodes.I want to find out what button was

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.