First of all, the good news: this is not really a bug in your code. It's a bug in the +1 Button itself. It seems that the HTML5 implementation is still buggy and ignores the href attribute. So your code is correct.
But as you decided to remove the choice of HTML5 and the Google syntax, I think this bug report is correct.
I tested the Google syntax and there it worked. So please either offer both variants or use the proprietary syntax only till the bug is fixed by Google.
PS: by the way, your HTML5-syntax isn't 100% valid, as you write "size" and "count" as attributes without the "data-" prefix. So "data-count" and "data-size" would be correct and valid HTML5. I haven't tested yet, if the code still works without the prefix.
Comments
Comment #1
agoradesign commentedOoooops, now a mistake happened to me too! Sorry, Google, your button works well with HTML5 syntax!
It's in fact a bug in your code. Of course, a div can't have a href attribute, and even if it could, you need the "data-" prefix for all arguments:
nice greets, Andi
Comment #2
corbacho commentedAs I said in the other issue, this bug is related to a drupal.org strange issue with the packaging of the zips, the zip version it's not what the git repository contains. #1188694: Zips to download doesn't correspond with git repository
So the rc6 version it's not what should be (when downloaded as a zip).
The HTML 5 tags should be correct for rc7. As you said, that was the problem.
Re-open if you see something weird.
Comment #3
corbacho commentedThanks Andi
Comment #4
agoradesign commentedNormally I always take the tar.gz, I don't know why I took the zip this time - interesting problem...
But I unfortunately I do have to reopen this issue. Because you're prefixing size and count correctly with "data-", but not the most important attribute, the href. If you try it in lists, you will see that it will only work, if you write "data-href".
I may explain the background: the href attribute is only available to a "a" element and specifies the destination of a link. What we have here, is not a link but a div that is providing metadata to the +1 script. In HTML5 any element can provide custom metadata with the help of "data-*" attributes. It was Google's decision to name the attribute they are looking for "href" and has nothing to do with the "normal" HTML attribute. They could have also named it "url" or "foo", then you would have to write "data-url",...
nice greets,
Andi
Comment #5
agoradesign commenteddownloaded and tested rc8 - now I'm fully satisfied, thanks :-)
I'll mark it as fixed again