Why can't I just type &

Discussion in 'Web Development and Programming' started by Adam, May 1, 2008.

  1. Adam

    Adam Regular Member

    Joined:
    Mar 17, 2008
    Messages:
    164
    Likes Received:
    0
    Location:
    USA - oursrc.com
    Why must I put &amp instead of just & to pass xhtml strict validation?
     
  2. rangana

    rangana Regular Member

    Joined:
    Apr 12, 2008
    Messages:
    106
    Likes Received:
    0
    Location:
    Cebu City Philippines
  3. Steven

    Steven Regular Member

    Joined:
    Mar 19, 2008
    Messages:
    18
    Likes Received:
    0
    Ah... I know this one.... XML(Being the base of XHTML) can not use curtain tags like < and > as well as &. & initiats a char code while ; closes it. You have to use &amp; other wise it disrupts the code. Also another good practice when using javascript and other scripts in your HTML is to use the <![CDATA[ ... ]]> Tag... This allows you to have any character in between this tag and the XHTML Processor will ignore it, and then javascript or which ever script for that matter will pick it up afterwords.
     
Similar Threads
Loading...

Share This Page