2

T have tried following code

OAuth.initialize(public-key);
            OAuth.popup('twitter', function(error, result) {
                console.log(result);
                result.get('/account/verify_credentials').done(function(data) {
                console.log(data);
                });       
                result.get('me').done(function(data) {
                    console.log(data)
                    alert('Hello ' + data.name)
                })
            });

I am able to login using that popup but not getting the info. I am getting oauth_token and oauth_secret_token only. I am getting following error

XMLHttpRequest cannot load https://oauth.io/request/twitter/me. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.

Can you please suggest me to get the user info. Thanks in advance.

4

1 回答 1

2

是的。我知道了。我使用了以下代码及其工作。

result.get("/1.1/account/verify_credentials.json").done(function(data) {
     console.log(data);
});
于 2014-03-03T13:27:16.237 回答