What can I get by validating XHTML in my blog? Well, some people say it can help Uncle Google to read and crawl your site, because Uncle is older and older and more hard to do reading. Before I use this code, my blog home page is always not valid due to a reason, after I insert a video from YouTube, some warnings and errors always occur. I search and find some tips to make YouTube Embed Video that you’ve insert is valid. Let’s take a look first with YouTube default Embed Code.
<object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/sJi6amKnNNE&hl=en&fs=1&"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://www.youtube.com/v/sJi6amKnNNE&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed> </object>
That code above is not valid by W3C XHTML validator. So you have to change that code into something different than above.
<object type="application/x-shockwave-flash" style="width:310px; height:260px;" data="http://www.youtube.com/v/XFcLU7hOeQI&hl=en&fs=1"> <param name="movie" value="http://www.youtube.com/v/XFcLU7hOeQI&hl=en&fs=1" /> </object>
This format above now is valid by XHTML Validator, but as you can see now, every YouTube Embed Code are always have ‘&’ ampersand. This is another problem that make your Embed Video is still not valid by XHTML Validator. For this problem, you have to change every ‘&’ to ‘&’
<object type="application/x-shockwave-flash" style="width:310px; height:260px;" data="http://www.youtube.com/v/XFcLU7hOeQI&hl=en&fs=1"> <param name="movie" value="http://www.youtube.com/v/XFcLU7hOeQI&hl=en&fs=1" /> </object>
That’s it. It’s working on my blog, may this tips can help you to validate your site when you insert an Embed Video from YouTube. You can comment if you want to ask or share about this article.
Popularity: 21% [?]




