[development] xhtml and embed tag: best way to compliance?
Farsheed
tfarsheed at yahoo.com
Wed Jun 7 21:04:23 UTC 2006
What about a server side solution? Check the PHP
variable:
<code>
$browser = $_SERVER['HTTP_USER_AGENT'];
//check to see if it is IE
$msie = (stristr($browser, "MSIE") ||
stristr($browser, "Internet Explorer");
</code>
Then on your code, you have an if statement to check
if the user is running internet explorer - if so use
the embed tags, otherwise use object.
Farsheed
--- Fabio Varesano <fabio.varesano at gmail.com> wrote:
> Hi everybody,
>
> I'm working on making my video module full XHTML
> compliant.
>
> At the moment the module uses a lot of embed tags
> for displaying video
> content (Quicktime, Flash, Wmv, Real, etc...).
>
> The problem is that embed tags are NOT part of any
> W3C standard and
> make a Drupal site which uses the Video module NOT
> W3 standard compliant.
>
> W3 compliant tag for embedding videos on xhtml pages
> is object but
> it's not well supported by Internet Explorer... so
> an object only
> implementation is not possible.
>
> So I investigate on some work around to create valid
> code but still IE
> compatible..
>
> And I finally get some types of solutions:
> 1 - Javascript hacks:
> basically leave only the object tag then onLoad add
> the embed tag to
> the document.
> 2 - CSS Tricks
> creating two nested objects then use some css hacks
> to hide one
> 3 - Extending XHTML
> extends default XHTML dtds to create a custom made
> embed tag
>
>
> While the first and second solutions are only hacks
> and are prone to
> errors and incompatibility between current and
> future versions of
> browsers, the third solution is much more elegant
> and should be
> supported by future versions of browsers without
> giving us headaches.
>
> So.. IMHO the best way in doing this is solution 3.
>
> Extending XHTML can be done in two ways:
> - creating a custom made DTD
> - extending an existing DTD by adding new rule as an
> internal subset
> directly in the document
>
> The problem is that using a customized DTD will
> produce a document not
> validable by W3C validator.. Other validators can be
> used.
>
> Instead extending DTD directly on document will
> create a W3 validable
> document but browsers (even firefox 1.5) will
> display a "]>" on the
> first line of the page...
>
> So... I'd like to hear your suggestion in facing
> this problem.
> For me the DTD extension on document is the best
> solution but I need
> to find some hacks to let browsers hide the "]>"...
>
> What do you think about this???
>
> Thank you.
>
> Fabio Varesano
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the development
mailing list