HTML5验证器在Facebook上失败OpenGraph XML命名空间xmlns:og [英] HTML5 validator failing on Facebook OpenGraph XML Namespace xmlns:og

查看:137
本文介绍了HTML5验证器在Facebook上失败OpenGraph XML命名空间xmlns:og的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML 5验证器在我的代码失败,尽管我遵循Facebook的文档信。有各种各样的问题,但我们从一个例子开始。

HTML 5 validator is failing on my code despite me following the Facebook documentation to the letter. There are a variety of problems but let's start with one example to start with.

我正在关注 Facebook入门文档并使用th5is代码:

I'm following the Facebook "Getting Started" documentation and using th5is code:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">

唯一的区别是在此之前与<!DOCTYPE html> for HTML5。当通过 W3C HTML5验证器运行时,我收到以下错误:

The only difference is I precede this with <!DOCTYPE html> for HTML5. When running it through the W3C HTML5 validator I get this error:

 Attribute xmlns:og not allowed here

只有我可以想到的错误是:

The only things I can think of what the error are:


  1. Facebook的文档错误

  2. m应该在<!DOCTYPE html> 声明中添加一些命名空间。

  1. Facebook's documentation is wrong
  2. I'm supposed to add some kind of namespace to the <!DOCTYPE html> declaration.

然而,无论哪种情况我都不知道修复是什么。会有一些帮助!

However, in either case I don't know what the fix is. Would love some help!

推荐答案

fb的文档没有错,但是他们打开网页的方法是。那些是fb专有属性值,所以他们不会去验证,除非w3c使它们成为标准。这可能听起来很阴沉,但只要这些是您唯一的验证错误,不用担心。验证是一个非常棒的工具,但请记住,它只是一个工具。

fb's documentation isn't wrong, but their approach to open web is. those are fb proprietary attribute values, so they're not going to ever validate, unless w3c makes them standards. that may sound gloomy, but as long as those are your only validation errors, don't worry about it. validation is an awesome tool, but remember, it's just a tool.

这篇关于HTML5验证器在Facebook上失败OpenGraph XML命名空间xmlns:og的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆