2013-08-06 46 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); 
    })(); 

应该工作。