Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12

Thread: Facebook code

  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Facebook code

    I have a facebook code script but I dont know if it is javascript or something else, the thing is it is not valid. Can anyone show me how to make it valid?

    <div class="rightside4">
    <h3>Follow us on Facebook</h3>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <fb:like href="http://www.facebook.com/pages/Lewisham-Community-Transport-Scheme/186259418081861" show_faces="true" width="255" font="tahoma"></fb:like></div>

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    I have a facebook code script but I dont know if it is javascript or something else, the thing is it is not valid. Can anyone show me how to make it valid?

    <div class="rightside4">
    <h3>Follow us on Facebook</h3>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <fb:like href="http://www.facebook.com/pages/Lewisham-Community-Transport-Scheme/186259418081861" show_faces="true" width="255" font="tahoma"></fb:like></div>
    you can't, the only thing you can do is to not use it, but i guess this not depend on you.
    comment the garbage untill you fix the rest of the page and uncomment after you finish.

    best regards

  • #3
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    Quote Originally Posted by oesxyl View Post
    you can't, the only thing you can do is to not use it, but i guess this not depend on you.
    comment the garbage untill you fix the rest of the page and uncomment after you finish.

    best regards
    dont know what you mean, comment the garbage and fix the rest of the page. He wants a like button so I have to use it.

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    dont know what you mean, comment the garbage and fix the rest of the page. He wants a like button so I have to use it.
    i hate facebook, i know some people want a 'like' button that is why i said that doesn't depend on you.
    about comment, do something like this:
    <!--
    <fb:...
    -->
    until you validate the rest of the page, then remove comments.

    but is possible to be a fix, modify the html tag and add the fb namespace like this:

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:fb="http://www.facebook.com/2008/fbml">
    best regards

  • Users who have thanked oesxyl for this post:

    quartzy (03-21-2011)

  • #5
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    thanks I will have to google it, the link you gavwe is 404

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    thanks I will have to google it, the link you gavwe is 404
    what link?

    best regards

  • #7
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    I have just realised what you were doing. I clicked on the facebook I thought it was alink, but I done it from my email.
    If I add the code you gave, in the head will it validate? Does not look right to me, and do I have to change the rest of the code? As maybe it will still not validate. Googled and found some fixes but you have to have a facebook account and sign up as a developer and get an api.

  • #8
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    I have just realised what you were doing. I clicked on the facebook I thought it was alink, but I done it from my email.
    If I add the code you gave, in the head will it validate? Does not look right to me, and do I have to change the rest of the code?
    you don't need to change the rest of your code, is the standard method do declare a namespace you use in the page and probably will validate,

    As maybe it will still not validate. Googled and found some fixes but you have to have a facebook account and sign up as a developer and get an api.
    i don't understand what you say. Is this fix connected with the fact that fbml will become obsolete?

    best regards

  • #9
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    What's a namespace?

    No they did not mention fb was going to be obsolete they mentioned how to add code to get the fb to validate. As I did not have an api account did not read properly.

  • #10
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    [QUOTE=quartzy;1067943]What's a namespace? [quote]
    each document type is described in a way, for example if we talk about xhtml, you can see in the doctype there is a url to http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd which is the description of xhtml.
    Now when you look to the head element you see this:
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    what is yellow is the namespace for xhtml and as you can see there is nothing after xmlns, that means this is the 'default namespace'.
    This make it possible to write the element as you know. Now if the namespace is not declared default the html element need to be 'prefixed'.
    For example using p as prefix will have:
    Code:
    <p:html xmlns:p="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    that means that each xhtml element must have a p: in from, for example you have p:div instead of div.

    now next question could be 'why all this complication?',
    the answer is simple, you can mix two type of documents, who have same name for elements. Example: having another type of document who also have defined a div element, let's say we talk about facebook, you can mix fb with xhtml:
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
             xmlns:fb="http://www.facebook.com/2008/fbml">
    ....
    <fb:div>this is a div but a facebook div</fb:div>
    <div>this is our usual xhtml div<div>
    the validator know about namespaces and test if your document follow the description of the documents. This is the short version of the story probably havy incomplete,

    No they did not mention fb was going to be obsolete they mentioned how to add code to get the fb to validate. As I did not have an api account did not read properly.
    i guess you don't need for validation purpose to make an fb account but if you want is not a big deal,
    try the solution with declaring the fb namespace and let me know if it work,

    best regards

  • #11
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    It is hard for me to understand you, but I changed the div to fb:div and changed the namespace to: xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml but the same errors remain, with the addition of the fb:div, another 3 errors.

    You do have to open up an account to get it to validate, as you have to place in the code your api number.

  • #12
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    It is hard for me to understand you, but I changed the div to fb:div and changed the namespace to: xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml but the same errors remain, with the addition of the fb:div, another 3 errors.
    what fb:div? you don't have any fb:div in your page, the one from my post have nothing to do with your problem, was an example for what i explaned.

    You do have to open up an account to get it to validate, as you have to place in the code your api number.
    it's easy to make an account and probably will be a good idea to have one, but i don't think you will solve this except if you build a like button using fb app and this means knowledge of javascript and/or php and another things about the techonolgy they use, like oauth for example, open graph.

    best regards


  •  

    Posting Permissions

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