Facebook as a button needs XHTML + RDFa, but it uses an iframe, which is not valid with this type of doctype

I think there must be something I'm missing.

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

Maybe someone put me right here?

... Mike

+4
source share
3 answers

With the help of this

DOCTYPE XHTML + RDFa 1.0

will 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> 
+1
source

You do not need this DOCTYPE only if you want it to pass the W3.org test, otherwise you should be fine and the OG tags should work. You can use the url url to check this:

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

I have done this many times, just using

 <!DOCTYPE html> 

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

0
source

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

 <!doctype html> 
0
source

Source: https://habr.com/ru/post/1346578/


All Articles