SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what does this mean ?

    What is this?

    &

    I see it lies in the middle of a link code

  2. #2
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    That's the ampersand, "&" HTML entity name.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a character entity reference for an ampersand, i.e., a '&' character.

    Ampersands have special meaning in HTML and need to be 'escaped' if you need to represent them literally. Much like you need to write &lt; (less than) to include a literal '<' character.

    If you use an unescaped ampersand in a URI value, you'll either get invalid HTML or a non-functional link.

    For instance, this is invalid:
    Code:
    href="http://example.com/index.php?x=1&y=2"
    The '&y' part is invalid, because it represents a reference to an entity named 'y', and there is no such entity.

    This, on the other hand, is valid, but doesn't do what you might intend:
    Code:
    href="http://example.com/index.php?id=1&copy=2"
    This represents a link to index.php?id=1&#169;=2 at example.com.

    The ampersand should be escaped in both cases, and must be escaped to work in the second case:
    Code:
    href="http://example.com/index.php?x=1&amp;y=2"
    href="http://example.com/index.php?id=1&amp;copy=2"
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the explanation


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
  •