Last active
August 29, 2015 14:00
-
-
Save AbhiAgarwal/abdca29f5225e7e24754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queryAPI = function() { | |
$.ajax({ | |
// URL of the API you want to access | |
url: 'https://housing.nyu.edu/api/nyuapirooms/RoomSpaceDescription/AH-002E1-1', | |
// When the data comes back | |
success: function(data) { | |
// Go through all the data | |
for(var eachval in data) { | |
// and print all of it out | |
console.log(data[eachval]["HallName"]); | |
console.log(data[eachval]["Street"]); | |
console.log(data[eachval]["Street2"]); | |
console.log(data[eachval]["City"]); | |
console.log(data[eachval]["StateProvince"]); | |
console.log(data[eachval]["Country"]); | |
} | |
} | |
}); | |
}; | |
// Call the function | |
queryAPI(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment