2013-08-06 42 views
0

喂按照本教程本地化的登錄按鈕

https://developers.google.com/+/web/signin/#customizing_the_sign-in_button

當我實施本土化腳本來顯示在韓語,德語或任何G +按鈕dissapear按鈕

<script type="text/javascript"> 
    // Specify the language code prior to loading the JavaScript API 
    window.___gcfg = { 
    lang: 'ko' 
    } 

    (function() { 
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 
    po.src = 'https://apis.google.com/js/client:plusone.js?onload=onLoadCallback'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 
    })(); 
</script> 

也許即時通訊做錯了,但代碼看起來很容易... 感謝您的時間和對我的英語感到抱歉。

回答

1

代碼的問題是,你在全局窗口配置標記後缺少一個分號:

<script type="text/javascript"> 
    // Specify the language code prior to loading the JavaScript API 
    window.___gcfg = { 
    lang: 'ko' 
    }; 

    (function() { 
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 
    po.src = 'https://apis.google.com/js/client:plusone.js?onload=onLoadCallback'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 
    })(); 

應該工作。