Jump to content

Youtube viddy + W3C Validation


RiFF

Recommended Posts

I am working on this website and yesterday I thought i'd embed a YouTube video, but when I attempted to validate it failed, then I switched from XHTML 1.1 to XHTML 1.0 Transitional but it failed aswel.Did anyone else have a similar problem or perhaps knows how to fix it, or perhaps there is no way of validating with an embeded YT video.website once again : http://www.riff.coldsteelclan.co.uk/test/index.php

Link to comment
Share on other sites

I am working on this website and yesterday I thought i'd embed a YouTube video, but when I attempted to validate it failed, then I switched from XHTML 1.1 to XHTML 1.0 Transitional but it failed aswel.Did anyone else have a similar problem or perhaps knows how to fix it, or perhaps there is no way of validating with an embeded YT video.website once again : http://www.riff.coldsteelclan.co.uk/test/index.php
there are ways to make it valid but some of the browsers wont understand without the embed tag. I wouldnt worry so much about 1 thing not validating. validation is more like a recomendation than a thing you have to have. you could just link to the video on you tube and then not have it on your site. that would solve your prolblem.
Link to comment
Share on other sites

Hmm, would it be possible to use javascript though?<script type="text/javascript">document.write('<embed src="..." etc. />');</script>Or are the script tags not valid in between <object></object> tags?

Link to comment
Share on other sites

Hmm, would it be possible to use javascript though?<script type="text/javascript">document.write('<embed src="..." etc. />');</script>Or are the script tags not valid in between <object></object> tags?
Not this script anyway. embed is still detected. Is there a way to escape the entitites and for the script to still work? Or simply an object to create a new element with certain name and attributes?Here's the markup I tested:
<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>simple document</title></head><body><div><object><script type="text/javascript">document.write('<embed />');</script></object></div></body></html>

And the only error is:

Line 12 column 34: element "embed" undefined.
However, the good news in this is that JavaScript is allowed as an alternative of an Object. The bad news in this approach is that it will requre the user to support JavaScript. Then again, if anyone is scared enough to turn JS off, (s)he would probably turn off embedded multimedia as well.
Link to comment
Share on other sites

How about this:<script type="text/javascript">var em = "<emb"var bed = "ed />"document.write(em+bed)</script>Would <embed /> be detected then?

Link to comment
Share on other sites

How about this:<script type="text/javascript">var em = "<emb"var bed = "ed />"document.write(em+bed)</script>Would <embed /> be detected then?
not <embed> but the element <emb/> with unstandart attributes and such. test it yourself with the direct input box. The problem is the "<" and ">" inside the script. That is why I asked if there is a way to escape them, while still running the script, or at least an alternative method of creating an element.
Link to comment
Share on other sites

Well, there is one way. :)Go here: http://www.codehouse.com/webmaster_tools/html_encoder/Enter the HTML code for the embed in the box.Then take the javascript code that is given to you and put it where you want your embed you appear. For example, here's how to write <embed>Hi</embed>:

<script type="text/javascript">document.write('\u003c\u0065\u006d\u0062\u0065\u0064\u003e\u0048\u0069\u003c\u002f\u0065\u006d\u0062\u0065\u0064\u003e')</script>

And it validates! :)

Link to comment
Share on other sites

Here's a slightly more readable idea:

<script type="text/javascript">document.write('\u003c' + 'embed src="path-to-your-file-or-whatever" /' + '\u003e')</script>

Simply replace the

embed src="path-to-your-file-or-whatever"

with your actual code for embed. No need to go to the encoder every time :). But wait. Does this work with FF and Opera?[edit]It is, but I was thinking of how it would accept the encoded HTML[/url]. [/edit]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...