After adding the new facebook like button on my page, it\'s no longer validates using XHTML strict standard. The two errors I come across are:
RE: Welcho
Found the script type was causing an error for me (XHTML 1.0 Transitional). Also added for those who may be missing that.
Your's is the best and easiest to use I have seen online to date. After looking over it again - ha! you're the best :)
Cheers and thnks :)
<div id="fb-root"></div>
<div id="FbCont">
<script type="text/javascript"
src="http://connect.facebook.net/en_US/all.js#appId=XYOURIDXyourapID=1">
</script>
<script type="text/javascript">
<!--//--><![CDATA[//>
<!--
var fb = document.createElement('fb:like');
fb.setAttribute("href","http://www.wakawakblahblah.com");
// fb.setAttribute("layout","button_count");
fb.setAttribute("send","true");
fb.setAttribute("action","recommended");
fb.setAttribute("show_faces","false");
fb.setAttribute("width","280");
fb.setAttribute("font","trebuchet ms");
document.getElementById("FbCont").appendChild(fb);
//--><!]]>
</script>
</div>
have you tried to add xmlns:fb="http://www.facebook.com/2008/fbml"
?
starting today you can also use HTML5-compliant markup
e.g. instead of
<fb:like href="example.org">
you can do
<div class="fb-like" data-href="example.org">
Since data-* attributes are valid in HTML5
Just a follow-up in case anyone uses the comment method. Facebook currently honors comments, so wrapping meta property tags in comments will cause Facebook to ignore them. If you check your pages with the Facebook URL Linter you can see they don't use commented-out meta tags.
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
@Eric I hope you eventually found what you were looking for.
Twitter integration has its difficulties if you want to empower developers to validate irrespective of XHTML Strict 1.0 or HTML5. Facebook, on the other hand, is down right impossible with its custom FBML tags.
On our last project my friend Jason and I knew two things for certain:
The solution is to use a flexible, asynchronous JavaScript module. Thankfully, we had some help and guidance along the way: http://techoctave.com/c7/posts/40-xhtml-strict-tweet-button-and-facebook-like-button