Google Plus button fails to load. Uncaught gapi.load
Everytime I launch my page containing a google plus icon I see the following error:
Uncaught gapi.load: Pending callback https://ssl.gstatic.com/webclient/开发者_开发技巧js/gc/23980661-3686120e/googleapis.client__plusone.js plusone.js:16
Any idea where this is coming from? This is the dating site I see the error on.
Did you duplicate the Javascript code part every time you have a +1 button (it's very likely that you have more than 1 +1 buttons on a single webpage)?
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
I had the same problem as yours, I removed the above Javascript where it is duplicated and only included it once with the <head>
tag of my webpage.
The error stopped showing up after that :)
I checked out your dating site a few minutes ago, still saw the error so hope this helps :)
This goes where you want the button to appear:
<g:plusone size='small' count='false' href='http://www.zxclasses.com'></g:plusone>
This goes just before your tag:
<script type='text/javascript'>
window.___gcfg = {lang: 'en-GB'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
Google says the script should appear after the final button, but some browsers error with something like NO_MODIFICATION_ALLOWED, if the code appears anywhere else than directly above
for IE7, i dont think so its working ...
精彩评论