I am trying to make a simple cross domain data request. After receiving the data “object Object” when making the request to my external site, I figured it was a problem with the server configuration so I ran a jsonp request to a twitter json feed and got the same “object Object repeated over and over again. Here is what I tried
$.ajax({
type: "GET",
url: "http://twitter.com/status/user_timeline/USERNAME.json?count=10&callback=?",
dataType: "jsonp",
success: function(data){
alert (data)
}
});
Any ideas? Is this code correct?
You are getting
object Objectmeans you are gettingobjectimplemented asObjectThis essentially mean that your jsonp request got some sort of response from the Twitter server.
To see the actual response, key in this url at your browsers address bar http://goo.gl/h3wcl
Now, to view it in browser you need to parse it.
You are missing out on the parsing part completely.
Here is a quick and dirty example on parsing json result using
$.eachDemo: http://jsfiddle.net/naveen/gSXFG/