Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Optimized Google PlusOne Javascript - Asynchronous/Non-Blocking, Minimal + SSL Fix
<!-- 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>
@pi3r

This comment has been minimized.

Copy link

commented Jun 27, 2011

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'}";

@stephanschubert

This comment has been minimized.

Copy link
Owner Author

commented Jun 27, 2011

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>
@Eroan

This comment has been minimized.

Copy link

commented Jun 29, 2011

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
You can’t perform that action at this time.