I have several widgets on the site that I am developing, and I load them asynchronously from the javascript file so that it does not delay the DOM from completing.
For example, I do this using Digg and Buzz widgets, and it works great:
function buzzShare() {
$jQ('.sharebox').append('<div class="widget"><a title="Post to Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count"></a></div>');
$jQ.getScript('http://www.google.com/buzz/api/button.js');
}
function diggShare() {
$jQ('.sharebox').append('<div class="widget"><a class="DiggThisButton DiggMedium"></a></div>');
$jQ.getScript('http://widgets.digg.com/buttons.js');
}
When it comes to the new Google +1 widget, the same logic doesn't work:
function plusOneShare() {
$jQ.getScript('http://apis.google.com/js/plusone.js');
$jQ('.sharebox').append('<div class="widget"><div class="g-plusone" data-size="tall" data-count="true"></div></div>');
}
I tried using the HTML5 and tag <g:plusone></g:plusone>. None of them work.
Here is the documentation for the service just launched: http://code.google.com/apis/+1button/
I also noticed that you can do the following if embedding the script directly in the HTML.
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{"parsetags": "explicit"}
</script>
Is there a way to use parameters {"parsetags": "explicit"}using jQuery .getScript?
P.S. plusOneShare, .
!