1

My code: <g:plusone annotation="inline"></g:plusone>

I get this error:

there is no attribute "annotation"
element "g:plusone" undefined

Why?

Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
Sachin Saini
  • 137
  • 2
  • 3
  • 10

2 Answers2

2

You have two choices

  1. Change to using this style markup <div class="g-plusone" data-size="tall" ... ></div>

  2. Add the XML NS for google's <g: syntax to the <html tag of the document. Now if only Google would share where that xml namespace is located... (So really, just try option 1)

DMCS
  • 31,720
  • 14
  • 71
  • 104
1

There is no attribute called "annotation" for any element recommended in the W3C standards. Google probably uses it to parse for some backend processing. If you want the +1 element, you cannot have a W3C standards code.

Check this thread. So what if custom HTML attributes aren't valid XHTML?

Community
  • 1
  • 1
Vikas
  • 264
  • 3
  • 9
  • 1
    It's not quite that simple. The `g:plusone` tag is not valid HTML. The attribute is merely an extra insult which is given as a result. – Chris Morgan Feb 04 '12 at 07:00
  • Oh, oh right. I didn't see the tag there. It is indeed invalid HTML. – Vikas Feb 04 '12 at 07:03
  • There is no "right" tag if you want the +1 element on your page. You have to use what is provided to you by Google. But your page will fail the W3C validation. You have to choose either of the options. – Vikas Feb 04 '12 at 07:32