Results 1 to 4 of 4

Thread: W3C Error because of '&'

  1. #1
    Join Date
    Apr 2012
    Posts
    85
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default W3C Error because of '&'

    Hello,
    I used to link my site to YouTube by using below location

    'http://www.youtube.com/v/V9btuDOVLVU?ersion=3&feature=player_detailpage'

    Its properly working but while checking w3c validations i got below error

    cannot generate system identifier for general entity "feature"

    I can not use '&amp' instead of '&' because it affects my actual location.

    can anyone help me to solve this issue?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Every time you use & in your HTML code, it should be &

    That avoids confusing with the & operator that starts entities like that, as in the term & itself. Or ", etc.


    Then it will be displayed as & and function that way, even in the case of URLs, etc. This SHOULD work, and it won't change the location that the URL points to-- browsers know how to deal with it.

    On the other hand, I've never actually seen this cause errors in a page. It isn't valid, but it's a minor problem. But it's also easy to fix.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by round View Post
    I can not use '&amp' instead of '&' ...
    clarification/elaboration: I don't know if the above is a typo or not but you should be using &amp; , NOT &amp .

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's right. And further, if it appears as a src attribute for an iframe and/or embed tag and/or as the value attribute of a param tag named 'movie', and/or as the data attribute of an object tag, using &amp; is fine and will not cause any problem. If it's part of a script, the script can be made external or have its code commented appropriately to the DOCTYPE being validated.

    In all these cases it will (assuming it worked with just &) work fine and will validate.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •