4

I think there must be something I'm missing.

  1. the facebook like button requires this as the doctype: < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
  2. The facebook like button is inserted using an iframe
  3. Iframes are invalid with this doctype

Can someone set me straight here?

...Mike

genesis
  • 50,477
  • 20
  • 96
  • 125
theMikeD
  • 41
  • 2
  • where did you read that facebook like button requires that DOCTYPE? – dragonjet May 31 '11 at 01:21
  • @dragonjet The like button alone does not need it, but you need the mentioned doctype if you want to include OpenGraph meta data on your page. See http://stackoverflow.com/questions/2834091/opengraph-w3c-valid – MicE Jun 09 '11 at 02:32

3 Answers3

1

With this

DOCTYPE XHTML+RDFa 1.0

will be work JS

<script type="text/javascript">
$(document).ready(function(){
        $('#iframe').after('<iframe src="url" scrolling="no" frameborder="0" overflow:hidden; width:400px; height: 70px;"></iframe>');
});
</script>
Anton Dimitrov
  • 51
  • 1
  • 1
  • 7
0

Currently, it seems that the only way for validator + facebook plugin to work is to use HTML5 doctype

<!doctype html>
Dmytro Dzyubak
  • 1,562
  • 2
  • 22
  • 35
0

You don't need that DOCTYPE, only if you want it to validate at W3.org otherwise you should be fine and the OG tags should still work. You can use the url linter to check this:

http://developers.facebook.com/tools/lint/

I've done this many times just using

<!DOCTYPE html>

I would have just added a comment for this to extend on what MicE said but I don't have enough REP yet!

TommyBs
  • 9,354
  • 4
  • 34
  • 65