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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:24+00:00 2026-06-17T09:42:24+00:00

I am getting back the following from an AJAX call which exactly matches the

  • 0

I am getting back the following from an AJAX call which exactly matches the syntax in my manual:

    var data = {        
    coach100:   {
        PID: '23169',
        POrt: '11'
        }, 

    coach200:   {
        PID: '23170',
        POrt: '11'
        } 
        };  

Now I want to extract one piece of data. The manual syntax is:

    data.coach100.PID  

but the Firebug console says: “TypeError: data.coach100 is undefined”

How to format the data in the variable “data” so that it can be extracted using dot syntax?

  • 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-17T09:42:25+00:00Added an answer on June 17, 2026 at 9:42 am

    This runs just fine in JSfiddle – http://jsfiddle.net/GWFe9/

    My guess is that you’re defining and calling data in the wrong place.

    If you’re calling your data outside of the success of the ajax but also defining it there you’re going to have a bad time.

    try adding var data; to the top of your doc so its a global variable – then when you get the success from ajax define your data like this –

    data = {        
        coach100:   {
            PID: '23169',
            POrt: '11'
            }, 
    
        coach200:   {
            PID: '23170',
            POrt: '11'
            } 
            };
    

    then you can call it at any time after it’s been loaded!

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

Sidebar

Related Questions

I'm having trouble getting a response back from a Jquery ajax call... (It's a
The JSON data I'm getting back from an API call has a character in
I'm getting a following response from the back-end servers to display the data as
I am currently getting the following data back from the server: { d: [
I'm getting a string similar to the following back from the database: The object
I am getting back the following dataset from my server {success:y,carrier:Verizon Wireless,isMobile:true} and when
I am getting back the following response from a charge-amount-notification. (in the sandbox env).
I'm getting the following (str) back from Disqus, JSON expected: ?({code: 0, response: {username:
Let's say you're getting the following response from an API call: [OrderArray] => SimpleXMLElement
I have this code getting back a password from the keychain for a given

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.