2

我正在使用此代码使用 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);
    });

}

如何跟踪用户是否单击取消而不是允许访问按钮?如果用户点击允许访问按钮 onLinkedInAuth 将触发但如果用户点击取消没有任何反应

4

0 回答 0