Jump to content

<embed> doesn't validate as XHTM Transitional


LifeInBinary
 Share

Recommended Posts

I've got something like this on two different pages, 1 is intro, the other is the main site:

<embed src="http://www.whatever.com/music_intro.m3u" autostart="true" loop="true" hidden="true" />

The W3C validator is giving me 5 errors on both pages because of that. How could I use CSS to embed that music so my code will validate?Here are the errors:

Line 20, Column 11: there is no attribute "src".<embed src="http://www.whatever.com/music_intro.m3u" ✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.  Line 20, Column 90: there is no attribute "autostart".…www.whatever.com/music_intro.m3u" autostart="true" loop="true" hidden="true" />✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.  Line 20, Column 102: there is no attribute "loop".…sic_intro.m3u" autostart="true" loop="true" hidden="true" />✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.  Line 20, Column 116: there is no attribute "hidden".… autostart="true" loop="true" hidden="true" />✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.  Line 20, Column 124: element "embed" undefined.…rt="true" loop="true" hidden="true" />✉ You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by: incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element), by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead). by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).

P.S. - I know music on a website is not recomended lol, so I don't wanna hear that, I just need this page to validate...

Link to comment
Share on other sites

...you can use a Javascript library to embed the Flash object, or you can use only the object tag. Do a search online for embedding Flash objects.
Well, it's not a flash object is the thing - all it is, is a simple .mp3 file to play in the background hidden. I'm also not familiar at all with JavaScript so, I don't even really know what you are talking about :)Really, all I need is a way to play a .mp3 and keep it hidden - and it must validate as XHTML Transitional...Here is the website, if it helps: http://www.iribbit.net/i/lifeisbinary/nexusdesigns/Sorry to be a bother - but I'm having a rough time accomplishing this lol ^^Thanks so much for your help,Life In Binary.
Link to comment
Share on other sites

Thanks a bunch Synook - that's what I was looking for. I'm not sure if you have any experience using the <object> tag for background music, but do you have any idea how I could set it up to loop an .mp3 and stay hidden? Preferably, I would like it to point to a .m3u file that points to the .mp3 file - because that way it plays as it is downloaded, instead of having to download the whole file before the music starts...I found this, if it helps you any: http://msdn2.microsoft.com/en-us/library/ms535198.aspxI'm totally in the dark on this - so ANY help would be 100% pure awesomeness :)Thanks,Life In Binary.

Link to comment
Share on other sites

  • 3 weeks later...
Tried using CSS to hide it?
<object style="display:none;" ... >

And in case that doesn't work, use "visibility:hidden;" instead. The space the element takes will remain (and hopefully it's functionality), but the element itself will be invisible.
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
 Share

×
×
  • Create New...