What's wrong with this jquery ajax call to the twitter api?


Hello - What’s wrong with the following jQuery ajax call to the Twitter API?:

$(function () {
url: ‘https://api.twitter.com/1.1/statuses/user_timeline.json’,
data: ‘count=2&screen_name=rickygervais’,
//crossDomain: true,
//beforeSend: setRequestHeader,
success: function(result){ alert(‘success’); },
error: ajaxError

I have this request executing successfully through Fiddler. Do I need to set the crossDomain ajax setting for this? My beforeSend is just setting xhr.setRequestHeader(‘Authorization’, ‘token val here’). I’m not getting any meaningful error information from this call…


set dataType: “jsonp” in the $.ajax options


Please suggest me to get twitter data through jquery