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 = "http://www.youtube.com/v/" & replace(link,"http://www.youtube.com/watch?v=","") & "&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
http://www.nealgrosskopf.com/tech/thread.asp?pid=18

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
ASP