JSFiddle - React, Tailwind, and code Playground
by rwaldron
JavaScript
$.ajaxSetup({
url: 'http://api.flickr.com/services/feeds/photos_public.gne?tags=jquery&format=json&jsoncallback=?',
});
$.ajax({
dataType: "jsonp",
success: function(data, textStatus, xhr) {
console.log(data, textStatus, xhr);
},
error: function(xhr, textStatus, errorThrown) {
console.log(xhr, textStatus, errorThrown);
}
});
$.ajax({
dataType: "json",
url: '/echo/json/',
data: {
json: JSON.stringify({
text: 'some text',
array: [1, 2, 'three'],
object: {
par1: 'another text',
par2: [3, 2, 'one'],
par3: {}
}
})
},
type: 'POST',
success: function(data, textStatus, xhr) {
console.log(data, textStatus, xhr);
},
error: function(xhr, textStatus, errorThrown) {
console.log(xhr, textStatus, errorThrown);
}
});