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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:15:03+00:00 2026-06-03T23:15:03+00:00

This should be very straight forward, but even looking at the other questions, I

  • 0

This should be very straight forward, but even looking at the other questions, I can’t get it to work.

I’m retrieving some sample world bank data from the following link:

World Bank Query

This returns the following JSONP structure:

getWorldBankData([
{
    "page": 1,
    "pages": 1,
    "per_page": "100",
    "total": 52
},
[
    {
        "indicator": {
            "id": "DC.DAC.FINL.CD",
            "value": "Net bilateral aid flows from DAC donors, Finland (current US$)"
        },
        "country": {
            "id": "GB",
            "value": "United Kingdom"
        },
        "value": null,
        "decimal": "0",
        "date": "2011"
    },
    {
        "indicator": {
            "id": "DC.DAC.FINL.CD",
            "value": "Net bilateral aid flows from DAC donors, Finland (current US$)"
        },
        "country": {
            "id": "GB",
            "value": "United Kingdom"
        },
        "value": null,
        "decimal": "0",
        "date": "2010"
    },

I want to get the title of the countries. I had been trying to do so with the following code:

function getWorldBankData(json){
    $.each(json.country ,function(){
        var country = "<option>"+this.value+"</option>"
        $('#category').append(country)
    });
}

But I get the following error:

    a is undefined
f()jquery.min.js (line 16)
a = undefined
c = function()
d = undefined
getWorldBankData()oil.js (line 11)
json = [Object { page=1, pages=1, per_page="100", more...}, [Object { indicator={...}, country={...}, decimal="0", more...}, Object { indicator={...}, country={...}, decimal="0", more...}, Object { indicator={...}, country={...}, decimal="0", more...}, 49 more...]]
DC.DAC.FINL.CD?per_page=100&date=1960:2012&format=jsonP&prefix=getWorldBankData()DC.DAC...ankData (line 1)
[Break On This Error]   

...all(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)...

It doesn’t like this line (line 11):

$.each(json.country ,function(){

What is the correct way to get the country? Thanks.

  • 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-03T23:15:04+00:00Added an answer on June 3, 2026 at 11:15 pm

    Haven’t tested it, but something like this should do the trick

    function getWorldBankData(json){
        var item;
        var itemArray = json[1];
        for (var i in itemArray ) {
            item = itemArray[i];
            $('#category').append("<option>"+ item.country.value+"</option>");
        };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be a very straight forward question, but I can't find an answer.
This might be something very straight forward and I really think it should work
This should be a very basic design question, but for some reason it doesn't
This should be pretty straight forward, and uploading works. BUT when I open the
I'm relatively new to the Python world, but this seems very straight forward. Google
I think this should be a simple straight-forward issue, however i am very new
This seems like it should be straight-forward, but I'm stumped. I have a link
This should be very simple, but I'm blocking on this.... Let's say, for the
This should be very easy but I don't know how to do it. I
I feel as if this should be very simple, but it's behaving strangely. I

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.