SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy YouTube embedd code breaking my W3C validation

    Hi Guys,

    I've been doing quite a bit of research on this and trying to find a fix, but with no luck.

    I was wondering why my new blog was getting some W3C validation errors when tested, and after doing a bit of research I learned it was because YouTube's embed code is not recognised as valid XHTML by W3C. So the pages with YouTube videos are showing as not valid W3C code!

    Can anyone help me get some clean code to fix this?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You have two choices - accept that browsers understand the invalid code and accept it as it is - or rewrite it to be valid. If you choose the second option then presumably you have enough knowledge of how to write valid HTML to be able to rewrite it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You see, I'm a graphic designer by profession, I can't post a link to my site I don't think because I'm a newb here. I can write valid code and do so for the agency I work for but I think the problem with the YouTube code is there is an "=" symbol where it shouldn't be, based on the error.

    I'm guess what I'm asking for is if there are any experts that can help me out here!

    I am happy that my site does work, but when others look at my site and know that I also do code for the web it looks bad if they validate it and see I have errors, regardless if it's just post content related, you know?

    So, any help?

  4. #4
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the specific validation error?

  5. #5
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    I managed to get this fixed through a bit more further research.

    I got the code that will work for Vimeo, and YouTube and validate via W3C... I would post here but again being a newb it won't let me!

  6. #6
    SitePoint Addict Zapppa's Avatar
    Join Date
    Aug 2009
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can still post your code though...

  7. #7
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did try that but it said that it detected a URL in the code and wouldn't let me until I had something like 5 posts!


Tags for this Thread

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
  •