RiFF Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
SFB Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
RiFF Posted September 23, 2006 Author Share Posted September 23, 2006 ok, thank you Link to comment Share on other sites More sharing options...
Jonas Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
boen_robot Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
Jonas Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
boen_robot Posted September 24, 2006 Share Posted September 24, 2006 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 More sharing options...
RiFF Posted September 24, 2006 Author Share Posted September 24, 2006 So in the end, the best way is just to post a link to the video, yes? . Link to comment Share on other sites More sharing options...
Chocolate570 Posted September 24, 2006 Share Posted September 24, 2006 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 More sharing options...
boen_robot Posted September 24, 2006 Share Posted September 24, 2006 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 More sharing options...
Chocolate570 Posted September 25, 2006 Share Posted September 25, 2006 It works in FireFox. Dunno about Opera, but why wouldn't it? It's simple javascript Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now