Igor
Igor

Reputation: 211

Element "embed" undefined, XHTML 1.0 Transitional (W3C)

I am trying to validate my page as XHTML 1.0 Transitional (W3C). And I have the following error: element "embed" undefined + there is no attribute "src", there is no attribute "quality", there is no attribute "width" there is no attribute "height", there is no attribute "align", there is no attribute "bgcolor", there is no attribute "name"

please see the source code:

<embed src="<?php info(template_directory); ?>/images/top-flash.swf"
    quality="high" bgcolor="#000099"
    width="960" height="362"
    name="flash" align="left"
    allowScriptAccess="sameDomain"
    allowFullScreen="false"
    wmode="transparent"
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    vspace="0" hspace="0"
    style="padding:0; margin:0;" />

Please help me to pass this validation.

Upvotes: 2

Views: 787

Answers (2)

Dmytro Dzyubak
Dmytro Dzyubak

Reputation: 1642

As @MichaelWagner has stated, element is really "not defined in XHTML 1.0 Transitional standard". However, another solution could be to not changing the doctype, but changing the embed to object. Thus Your code for including a .swf file could look like this:

<object type="application/x-shockwave-flash" data="TEMPLATE_DIRECTORY/images/top-flash.swf" width="960" height="362" name="flash" align="left" style="padding:0; margin:0;">
    <param name="movie" value="TEMPLATE_DIRECTORY/images/top-flash.swf" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowfullscreen" value="false" />
    <param name="bgcolor" value="#000099" />
    <param name="quality" value="high" />
    <param name="wmode" value="transparent" />
    <a href="http://get.adobe.com/flashplayer/">Get Adobe Flash Player</a>
</object>

Results in: This document was successfully checked as XHTML 1.0 Transitional!

The following transformations apply (from embed to object):

  • allowScriptAccess="sameDomain" > <param name="allowScriptAccess" value="sameDomain" />
  • allowFullScreen="false" > <param name="allowfullscreen" value="false" />
  • bgcolor="#000099" > <param name="bgcolor" value="#000099" />
  • quality="high" > <param name="quality" value="high" />
  • wmode="transparent" > <param name="wmode" value="transparent" />
  • pluginspage="http://www.macromedia.com/go/getflashplayer" > <a href="http://get.adobe.com/flashplayer/">Get Adobe Flash Player</a>

Don't forget to change TEMPLATE_DIRECTORY/images/top-flash.swf to the original <?php info(template_directory); ?>/images/top-flash.swf

Upvotes: 3

Michael Wagner
Michael Wagner

Reputation: 1038

The embed element is not defined in XHTML1.0 Transitional standard. You have to remove the element or change your doctype to pass the test.

Upvotes: 1

Related Questions