开发者

Facebook namespace problem causing invalid code

I have seen various articles on this site and on google about how to make facebook code valid, but none of the solutions seem to work for me. I think the problem lies in my doc type decleration:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org开发者_运维百科/1999/xhtml" xml:lang="en" lang="en"  xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/"  >

...

<meta property="og:site_name" content="my site name" />
<meta property="og:title" content="Buy...

Can anyone point me in the right direction please?

John


I'm having a similar problem.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xml:lang="nl-NL">
...
<meta property="og:type" content="book" />

That's how almost all examples are like, and strangely it validates on w3c's validator, however all other validators including CSE Html validator and http://check.rdfa.info need a og prefix in front of the meta tag:

<og:meta property="og:type" content="book" />

That validates in almost anything except the official w3c validator. Not sure if facebook will parse it either. Why they chose not to use "name" is a big mystery for me. What a fine mess!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜