JavaScript AJAX Basics (retiring) AJAX and APIs Displaying the Photos

Andy tran
Andy tran
7,111 Points

Can I use $.ajax() for requesting jsonp as alternative to $.getJSON method?

is there any way I can use $.ajax() to make jsonp request? How can I do it?

1 Answer

gerardo keys
gerardo keys
Full Stack JavaScript Techdegree Student 14,275 Points

Yes! This would be the equivalent:

$.ajax({
      dataType : "json",
      url : flickerAPI,
      data : flickrOptions,
      success : displayPhotos
    });