Created
June 7, 2011 17:48
-
-
Save stephanschubert/1012736 to your computer and use it in GitHub Desktop.
Optimized Google PlusOne Javascript - Asynchronous/Non-Blocking, Minimal + SSL Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place this tag just before your close body tag and NOT in your <head> --> | |
<script> | |
(function(d, t) { | |
var g = d.createElement(t), | |
s = d.getElementsByTagName(t)[0]; | |
g.async = true; | |
g.src = 'https://apis.google.com/js/plusone.js'; | |
s.parentNode.insertBefore(g, s); | |
})(document, 'script'); | |
</script> |
I would use the the HTML attribute on each button instance:
<div lang="fr" class="g-plusone" data-count="true" data-size="small" href="..."></div>
It doesn't work Jazen.
Even using the data-lang="fr" doesn't...
It seems the only way to set-up another language is to use the basic structure {lang: 'fr'} !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for this gist, do you know how i can pass the lang parameter using your script?
*** edit ***
That line seems to work fine :
g.textContent = "{lang: 'fr'}";