SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to bypass w3c validation in case of facebook like code

    i am amazed how this guys <snip/> have bypass the w3c validation without touching the facebook like gadget.. they are just excellent.

    Please Tell me if anyone have got idea?

    thanks
    Last edited by Mittineague; Jan 14, 2014 at 14:23.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,588
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    What do you mean by 'bypass the w3c validation'?

  3. #3
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well if when i use facebook like button on my website its create error when i try to validate w3c and if i change the code which facebook provide its not work anymore..

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,588
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    It doesn't really matter if the FB code doesn't validate. Validation is only a guide, to warn you if there are potential problems.

    Anyhow, that site you linked to probably validates because it is using an outdated doctype, which allows for old-style coding:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    You are probably using a more modern doctype. Changing to an old doctype might get rid of your validation errors, but that's a bit like sticking your head in the sand to make your problems go away.

    FB code just doesn't validate, so if you are going to use it, you have to accept that. There are no prizes for clean validation, anyhow. It's just a way of checking if there are any major issues that may cause your page to break. The FB button won't do that, though, so it's not a problem.

  5. #5
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply sir, My question is " If i leave it as it is.. will it affect SEO for my webpage?? "

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,588
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    No, it shouldn't affect it at all. Validation is not really an SEO issue.

  7. #7
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you..

  8. #8
    SitePoint Member
    Join Date
    Feb 2013
    Location
    Chandigarh, India, India
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Here is the Answer

    <div id="fb-root"></div>
    <script type="text/javascript" language="javascript">
    //<![CDATA[
    (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    //]]>
    </script>
    <script type="text/javascript" language="javascript">
    // <![CDATA[
    document.write('<fb:like href="url" send="false" width="450" show_faces="false"></fb:like>');
    // ]]>
    </script>
    </div>


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •