Friday, 3 June 2011

Google PlusOne HTML 5 API Broken

Google's new +1 Button normally mandates a somewhat cumbersome <g:plusone> tag, but this tag is not HTML compliant without a custom DTD, and worse, is unselectable by jQuery using normal selectors.

Thankfully, they also provide an HTML 5 <div class="g-plusone"> option.

While the <g:plusone> tag is configured with 'size' and 'url' attributes, in order to be HTML 5 compliant, the <div> version passes parameters using HTML 5's 'data-' attributes, such as 'data-size' and 'data-url'.

Or at least, that's what the documentation says.

In actual fact, the HTML 5 version ignores data- attributes, and responds only to normal, non-data attributes.

I have put together a test case to illustrate the problem:
Test case demonstrating the broken +1 HTML 5 implementation.

Hopefully Google will address this quickly.

Update, June 14 2011
The test case now renders correctly, indicating that Google has fixed the problem. Hooray!

No comments:

Post a comment