How to solve HTML5 validation error on fb-like box?

拥有回忆 提交于 2019-12-06 06:53:40

问题


How to solve this HTML 5 validation error related to Facebook like button?

Here is the text from validation engine:

Line 3170, column 261: Element name fb:like-box cannot be represented as XML 1.0.

…rue" border_color="" stream="false" header="false" height="260" ></fb:like-box>

Here is the code on Line 3170:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/fburlhere" width="250" show_faces="true" border_color="" stream="false" header="false" height="260" ></fb:like-box>

Just after this error, there is also another error which reads:

Element fb:like-box not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

referring to the same line number.


回答1:


The markup are dynamically placed/generated from Facebook itself. You cannot control them, the way you want. But there is a HTML5 version of the Like Box, you can use instead.

When you are generating the code for the like-box. You will get an option like

[Source]

来源:https://stackoverflow.com/questions/9988981/how-to-solve-html5-validation-error-on-fb-like-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!