How do I remove a facebook comment warning?

后端 未结 4 1494
时光取名叫无心
时光取名叫无心 2021-01-22 15:03

my fb comments code is:

\" width=\"600\"  xid=\"\" notify=\"true\"  candelete=\"true\" si         


        
4条回答
  •  不知归路
    2021-01-22 15:57

    I wrote a complete tutorial with a small use of JS to solve this issue. Visit the tutorial


    What I did was:

    • Set off the parse for XFBML tags in the JS SDK
    • Adding a function-call to the JS SDK with a date parameter that you manually set it once with a date that posts published after that date will start using the 'href' version, and posts published until that date will use the migrated version.
    • Adding another attribute to the fb:comments tag which is 'data-date' and in it's value you place your post date (dynamic code).
    • Calculating the dates in a JS code, and base on the result it's removing the not wanted attributes, and finally then it's render the XFBML tags using FB.XFBML.parse

提交回复
热议问题