Return to Snippet

Revision: 6898
at June 24, 2008 07:55 by neal_grosskopf

Initial Code
Function YouTubeCleanup(embed,link)

	if len(replace(embed,"youtube","")) << len(embed) then
		url = "" & replace(link,"","") & "&hl=en"
		embed = "<object type=""application/x-shockwave-flash"" data=""" & url & "&hl=en""><param name=""movie"" value=""" & url & """></object>"
	end if	
	YouTubeCleanup = embed

End Function

Initial URL

Initial Description
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.

Initial Title
Make YouTube Embed HTML Validate

Initial Tags
function, validation, ASP

Initial Language