Re: Validation errors using FaceBook's LIKE and COMMENT plugins

B.H.

On Thu, Dec 2, 2010 at 11:31, Karl-Heinz Grusch <kagruschi@googlemail.com>
 wrote:

> My site is using the following headers:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
> http://www.w3.org/TR/html4/loose.dtd">
>
> and I have included the FaceBook LIKE and COMMENT plugins with XFBML. When
> I perform an HTML validation here:
>
> http://validator.w3.org/check?uri=http%3A%2F%2Fwww.suitsties.info%2Fproducts%2F62%2Ffrench-cuff-dress-shirt.html&charset=%28detect+automatically%29&doctype=Inline&group=1&accept=*%2F*&accept-language=en-us&user-agent=W3C_Validator%2F1.1
>
> I get Validation Output: 7 Errors, and all 7 errors are related to the
> FaceBook LIKE and COMMENT tags.
>
> element "FB:LIKE" undefined
> element "FB:COMMENTS" undefined
> and all attributes inside the FB tags get: there is no attribute X
>
> How do I change my headers so that these elements are defined and my page
> can validate with no errors?
>
> Hi!
>
> I have the same Problem on my Website!
>
> But if I do the validation, the output says 9 Errors - 7 related to
> Facebook, and 2 HTML errors.
> I have checked the complete source, especially the complete HTML but didn't
> found anything.
>
> I have removed the Facebook plugin and all works fine...
>
> Has anybody a solution or the same problem?
>

I had the same question (posted here some weeks ago). Didn't get any answer,
but IMHO xfbml namespace is not considered a "standard" namespace for html
documents so it's not recognized by the validator.

A simpliest workaround to get your pages validate is to use something like:

<script type="text/javascript">/* <![CDATA[ */

document.write('<fb:like></fb:like>');

/* ]]> */</script>

This is considering your document is XHTML (to use CDATA)


>
> ----------------------------------------------
> Karl-Heinz Grusch
> http://www.winterstiefeldamen.org
>



-- 
Moshiach is coming very soon, prepare yourself!
יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד!

Received on Thursday, 2 December 2010 14:23:09 UTC