google plus的标识有时显示正常,没有错误,有时不显示,并在控制台上给出这个错误:
TypeError: a is undefined
...pi.auth,e={client_id:c,session_state:b};a.checkSessionState(e,function(b){var c=.
我的代码是:
& lt;Div class="g-page" data-href="https://plus.google.com/+google"Data-theme ="dark" data-showtagline="true" data-showcoverphoto="true"出版商data-rel = " ">
<!-- Place this tag after the last widget tag. --><script type="text/javascript">
window.___gcfg = {
lang: 'de'
};
// just put this in here
document.getElementsByClassName('g-page')[0].setAttribute('data-width', document.getElementById('google-badge').clientWidth);
(function () {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
编辑:a在Google API中定义如下:https://apis.google.com/js/platform.js
我有同样的问题。我认为google badge库与其他javascript库(如AngularJS)存在冲突。