1

jsapiによって生成されたLinkedInボタンのトリガーを作成しようとしています。デスクトップブラウザでは完璧に機能しますが、モバイルブラウザ(iOS、Androidブラウザ)では機能しません。

コードは次のとおりです。

HTML:

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: i6fpkmpak7qu
  authorize: true
</script>
<a href="#ln" title="Autentificare cu LinkedIn" id="sidebar_auth_ln" class="ln_auth_link"></a>
<div class="hidden_ln_login_holder">
    <script type="IN/Login" data-onAuth="onLinkedInAuth"></script>
</div>

Javascript:

$(document).ready(function(){
    $('.ln_auth_link').click(function() {
        DIV = $(this).next();
        $('a span:first', DIV).live('click', function() { return true; });
        // also tried $('a span:first', DIV).click();, $('a span:first', DIV).trigger('click')
        return false;
    });
});

上で述べたように、これはモバイルの問題のみです。さらに、このコードを使用する場合

alert($('a span:first', DIV).html());

デスクトップブラウザと同じように、「ln」がポップアップ表示されます。

また、パーツを非表示にせずに右にタップすれば、ログインは問題なく機能します。

コードが公開されているアドレスは次のとおりです:http:// test [dot] lacontabil [dot] ro

何か案は?ありがとうございました!

4

1 に答える 1

0
 <script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key:
//onLoad: onLinkedInLoad
scope: r_basicprofile r_emailaddress r_fullprofile
authorize:true
</script>

<script type="text/javascript">
function onLinkedInAuth() {
IN.API.Profile("me")
.fields("firstName", "lastName", "industry", "location:(name)", "picture-url", "headline", "summary", "num-connections", "public-profile-url", "distance", "positions", "email-address", "educations", "date-of-birth")
.result(displayProfiles);
IN.UI.Share().params({
url: "http://www.example.com"
}).place()
}
function displayProfiles(profiles) {
console.log(profiles);
member = profiles.values[0];
}
jQuery(document).ready(function(){
jQuery("#linkdinlog").click(function(){
IN.UI.Authorize().place();
IN.Event.on(IN, "auth", onLinkedInAuth);
});
});
</script>
<a href="javascript:void(0)" id="linkdinlog">link</a>

カスタムボタンをクリックして呼び出すことができます

于 2014-05-09T12:52:33.623 に答える