Answer the question
In order to leave comments, you need to log in
How to display text from json?
Here is the response from the server: pastebin.com/Dc8wz9cB
How to display the country ID and name?
Answer the question
In order to leave comments, you need to log in
countries[0][0] // 19
countries[0][1] // Australia
countries[1][0] // 20
countries[1][1] // Austria
This will output to the console:
json.countries.forEach(function(country) {
console.log(country[0]+ ' : ' +country[1]);
});
json.countries.forEach(function(country) {
$("body").append(country[0]+ ' : ' +country[1]+'<br>');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question