W3C Validate your youtube embed code

Her’s the thing if you take embed code from a youtube chanel and paste it on your webpage you get loads of validation errors.  Try to validate a youtube page (c;
So how do you fix this ,.. here’s an eksample of such embed code

<object width="{$width}" height="{$height}">
<param name="movie" value="{$playUrl}"/>
<param name="allowFullScreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
<embed src="{$playUrl}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="{$width}" height="{$height}"/>

this will fail validation bigtime,.. to remedy this get rid of the embed tag, which is  leftover from the good netscape days. Like this

<object type="application/x-shockwave-flash" style="width: {$width}px; height: {$height}px" data="{$playUrl}">
<param name="movie" value="{$playUrl}" />

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: