Skip to content

Instantly share code, notes, and snippets.

@maninthemirror
Forked from codingjester/ajax_jsonp.js
Created February 18, 2016 11:53
Show Gist options
  • Save maninthemirror/6d22a6398ab89c67728f to your computer and use it in GitHub Desktop.
Save maninthemirror/6d22a6398ab89c67728f to your computer and use it in GitHub Desktop.
User JQuery with the Tumblr API & JSONP
$.ajax(
'http://api.tumblr.com/v2/blog/codingjester.tumblr.com/posts?api_key=<your_key>',
{
dataType: 'jsonp',
success: function (d) {
console.log(d); // On success log the data to the console
},
}
);
// More explicit information
$.ajax('https://api.tumblr.com/v2/blog/codingjester.tumblr.com/posts',
{
dataType:'jsonp',
data: {
limit : 1,
api_key : 'your_key'
},
success: function(d) {
console.log(d);
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment