Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Get details about countries through API, AJAX
  • Loading branch information
TabishRehmatullah authored Oct 31, 2021
1 parent 0a81f1a commit a884d5a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions countries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function get_countries(){
$.ajax({
url : "https://restcountries.eu/rest/v2/all",
type: "GET",
dataType: "JSON",
success: function(data){
populate_countries(data);
},
failure: function(){
console.log("Error");
}


});

}
function populate_countries(countries){
for(var a= 0; a< countries.length; a++){
console.log(countries[0].name)
}
}
get_countries();

0 comments on commit a884d5a

Please sign in to comment.