0

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!

2 Answers 2

1
$.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);
}
});
Sign up to request clarification or add additional context in comments.

Comments

1

Accesspattern for the smallest image: image.available_sizes[0][1];.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.