Reputation: 2833
I'm trying to parse the first logo image (assets/images/resized/0002/3133/23133v9-max-150x150.png) from this JSON file.
http://api.crunchbase.com/v/1/company/airbnb.js
This is how I parse the other data, but I can't figure out how to get that image:
$.ajax({
url: "http://api.crunchbase.com/v/1/company/airbnb.js",
dataType: 'jsonp',
success: function(results){
var number_of_employees = results.number_of_employees;
var founded_month = results.founded_month;
var founded_year = results.founded_year;
$('#number_of_employees').append(number_of_employees);
$('#founded').append(founded_month + '/' + founded_year);
}
});
Any help is greatly appreciated!
Thanks!
Upvotes: 0
Views: 729
Reputation: 287755
$.ajax({
url: "http://api.crunchbase.com/v/1/company/airbnb.js",
dataType: 'jsonp',
success: function(results){
// ...
var imgUrl = 'http://crunchbase.com/' + results.image.available_sizes[0][1];
// Display the image (requires <img id="myImage"/> in the document)
$('#myImage').attr('src', imgUrl);
}
});
Upvotes: 1