I would like to use the data you get when calling the following URL from my browser: https://api.twitter.com/1/friends/ids.json?cursor=-1&user_id=92558104
My question is: how can I make the same action with jQuery (something like a post-request maybe?) and catch the received data?
You can use jQuery’s
$.getJSONto do so.Like:
The success handler function specified in the
$.getJSONcall receives adataargument that will contain the data returned by your request. See this fiddle. In case you need error handling you can (should) also add another function for that.Be aware that you need to make sure you are using JSONP here as this will probably be a cross-domain-request. This can be done adding a plain
&callback=?to the URL your are calling. See the twitter docs for info on that.