Skip to content

Instantly share code, notes, and snippets.

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> -->
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = '';
s.parentNode.insertBefore(g, s);
})(document, 'script');

This comment has been minimized.

Copy link

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


This comment has been minimized.

Copy link
Owner Author

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

This comment has been minimized.

Copy link

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