Facebook LIKE 按钮和 W3C 验证失败
http://developers.facebook.com/docs/reference/plugins/like
要包含来自 facebook 的流行 [Like] 按钮,我必须使用以下代码:
<iframe src="http://www.facebook.com/plugins/like.php?href=www.MyDomain.com&layout=standard&show_faces=false&width=225&action=like&font=lucida+grande&colorscheme=dark&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:80px;" allowTransparency="true"></iframe>
由于 allowedTransparency 属性,我的网站不再在 W3C 上验证:
Line 313, Column 342: there is no attribute "allowTransparency"
… overflow:hidden; width:250px; height:80px;" allowTransparency="true"></iframe>
有解决办法吗?我无法使用 XFBML 版本。这非常糟糕..
http://developers.facebook.com/docs/reference/plugins/like
To include the popular a [Like] button from facebook, I must use the following code :
<iframe src="http://www.facebook.com/plugins/like.php?href=www.MyDomain.com&layout=standard&show_faces=false&width=225&action=like&font=lucida+grande&colorscheme=dark&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:80px;" allowTransparency="true"></iframe>
My website no longer validate on W3C because of the allowTransparency attribute :
Line 313, Column 342: there is no attribute "allowTransparency"
… overflow:hidden; width:250px; height:80px;" allowTransparency="true"></iframe>
Is there a way around? I cannot use the XFBML version. This is pretty bad..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您是否尝试过忽略此属性?不应该需要它。标准就更不用说了。
Have you tried omitting this attribute? It should not be required. The standards to not even mention it.
好吧,在浏览了数百篇这样的帖子之后,我终于找到了一种快速简单的方法来获取带有“赞”按钮(或任何其他 Facebook 小部件)的有效页面。
实际上只需几行代码,请查看 http: //www.liormark.com/develop/development-articles/facebook-fbml-w3c-validation-solved
Ok, after going over literally hundreds of these posts, I finally found a quick and easy way to get a valid page with a Like button (or any other facebook widget) on it.
Just a fewlines of code really, take a look at http://www.liormark.com/develop/development-articles/facebook-fbml-w3c-validation-solved
以下代码应该可以解决验证问题:
The following code should fix the validation issue:
如果我没记错的话,allowtransparency是微软编造的一个属性。那么,是否对 Internet Explorer 系列使用不同的代码以使其正常工作,并使用不同的代码让其他浏览器进行验证?
虽然这不是您应该担心的事情,但遵循标准是一件好事,但如果您的网站因为类似的事情而无法验证,那也不是世界末日。
If I remember correctly, allowtransparency is an attribute that Microsoft made up. So use a different code with Internet Explorer family to make it work and different code for other browsers to validate?
Although it's not something you should worry about, it's a good thing to follow the standards, but if your site doesn't validate because of things like that, it's not the end of the world.
这是最好的代码:
享受......:)
Here is the best code:
Enjoy....:)