I cannot get this $.ajax function to work in Chrome. When I make the ajax request, a response is never returned. When I view this in Chrome dev tools, it states that the json request is still pending. So far, I have found suggestions to add these parameters to the options.
'{type: "post", data: '', cache: false, async: false}'
However, none of these options made it work.
try {
var o = {username: 'adobeedge', count: 4};
var twitterUrl = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=' + o.username + '&count=' + o.count;
$("body").append('<p>attempting ajax</p>');
$.ajax({url: twitterUrl,
dataType: 'jsonp',
type: "post",
data: '',
cache: false,
async: false,
})
.success(function(data) {
$.each(data, function(index, item) {
$("body").append(item.text);
});
}) ;
}
catch (error) {
alert("Error: " + error.toString());
}