Difference between ' and " in the code. Is it important?

Discussion in 'Programming' started by zbreeze, Dec 23, 2008.

  1. #1
    Hi...

    I'd like to know the difference between...

    1. rel="nofollow" AND 2. rel='nofollow'

    This because I'm optimizing my site and I don't want search engine to follow some links in my website so I apply that attribute to some hyperlinks.

    The thing is I'm not good in technical so I ask a webmaster to do that for me. He put the attribute like number 2 with ' instead of "... I saw sample of this kind of attribute on the internet and almost all of them us something like number 1.

    But my webmaster told me it's the same which doens't make any different at all so I'd like to know if it's true? I'm afraid it will not work with search engine if it's wrong.

    Thanks in advance.
     
    zbreeze, Dec 23, 2008 IP
  2. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm pretty sure there's no difference in terms of how a search engine or anything like that sees it. I guess the only real difference between which type to use in HTML is whether or not you'll actually have one or the other in the value itself.

    Example: If you had the title of an anchor tag set to "I'm a title!", you could not use ' to enclose it as it would prematurely close it after the I (because of the apostrophe in I'm).
     
    zerxer, Dec 24, 2008 IP
  3. krzyk

    krzyk Peon

    Messages:
    61
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Even more, most of the time you could just leave out quotes alltogether: rel=nofollow
    Robots will follow it, most browsers (probably 99%) will undesrtand it, but it's not a valid HTML.
     
    krzyk, Dec 25, 2008 IP
  4. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #4
    In c [the programming language] a single ' quote normal identifies a single character while a " double quote is for a string [of characters]. The internet, specifically HTML and JavaScript tend to ignore the distintion that c makes and uses them more like strings no mather if 1 character in length or mutliple.

    I am pretty sure the code that Google or other search engines use to read the HTML file is written in C, however probably reads the ['] single quote and ["] double quote the same way when parsing HTML files-- because it is an HTML file and makes no distintion between the two.

    Q...
     
    QiSoftware, Dec 25, 2008 IP