Linkedin Api如何检测用户是否点击取消按钮

时间:2015-06-16 13:59:25

标签: javascript linkedin-api

我正在使用此代码使用Linkedin APi for Javascript验证用户

 <script type="text/javascript" src="//platform.linkedin.com/in.js">
        api_key: xxxxxx
        authorize: true
        onLoad : onLinkedInLoad

    </script>

function onLinkedInLoad() {

    $('a[id*=li_ui_li_gen_]').css({ marginBottom: '20px' }).html('<a class="btn btn-default">sign in with linkedin</a>');


    IN.Event.on(IN, "auth", onLinkedInAuth, ext);
    console.log(ext);

}

function onLinkedInAuth() {
    var isauthorized = IN.User.isAuthorized();
    debugger;

     IN.API.Profile("me").fields("positions","educations", "first-name", "id", "last-name", "email-address", "picture-url", "picture-urls::(original)", "maiden-name", "headline", "industry", "summary", "public-profile-url", "location", "date-of-birth").result(function (data) {
        console.log(data.values[0]);
        console.log(data.values[0].pictureUrls.values[0]);
        user_id = data.values[0].i;
    }).error(function (data) {
        console.log(data);
    });

}

如何跟踪用户点击取消而不是允许访问按钮? 如果用户单击“允许访问”按钮,则会激活“链接”,但如果用户单击“取消”则不会发生

0 个答案:

没有答案