Make YouTube Embed HTML Validate

/ Published in: ASP
Save to your folder(s)

YouTube offers a method for users and developers to embed video on their web pages. Unfortunately the code that they use doesn't validate. Use this function to make YouTube's embed code validate.

Copy this code and paste it in your HTML
  1. Function YouTubeCleanup(embed,link)
  3. if len(replace(embed,"youtube","")) << len(embed) then
  4. url = "" & replace(link,"","") & "&hl=en"
  5. embed = "<object type=""application/x-shockwave-flash"" data=""" & url & "&hl=en""><param name=""movie"" value=""" & url & """></object>"
  6. end if
  7. YouTubeCleanup = embed
  9. End Function


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.