Question: I am new to the world of AJAX and I cannot for the life of me figure out how to authenticate my JSON request. The API documentation is speaking in riddles to me. This is what I have so far-

```
$.ajax({
      type: "GET",
      url : "https://api.twitter.com/1/statuses/home_timeline.json?",
      dataType: "json",
      data: {
          oauth_token : "myTokenHere",

      },
      error: function(){
          alert('you loooose, sucka');
      },
      success: function(){
         alert('in like Flynn');
      }

  });

```

Can somebody please throw me a bone here? Much appreciated

Answer: 
As Nix mentioned in the comment. Your approach of doing this kind of stuff is completely wrong. Please implement those requests to twitter in your serverside logic. You can get your desired content via AJAX i.e. with an REST interface, like: www.yourdomain.com/getTwitterStuff

This is much cleaner and you also wont expose your twitter o\_auth.
How about using [jsOAuth](https://github.com/bytespider/jsOAuth) ?
maybe this way it's a bit easier.
Here an [example](https://gist.github.com/979955)