| Author |
W3C Validation errors.
|
|
|
| Hi all,
I am getting the following error:
Error Line 56, column 33: document type does not allow element "object"
here .
<object width="410" height="335">
They are saying the last '>' is causing the error.
This is the code:
<script type="text/javascript">
function showVideo(id) {
document.getElementById('yt_the_video').innerHTML =
<object width="410" height="335">
<param name="movie" value="http://www.youtube.com/v/' + id + '"></param>
</object>
}
</script>
Anyone have any suggestions?
Thanks
| |
| Murray *TMM* 2006-02-07, 10:40 pm |
| document.getElementById('yt_the_video').innerHTML = '<object width="410"
height="335"><param name="movie" value="http://www.youtube.com/v/' + id +
'"></param></object>'
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Beds" <owlservice@XXXXXXXXXX> wrote in message
news:drfrm6$aom$1@forums.macromedia.com...
> Hi all,
>
> I am getting the following error:
>
> Error Line 56, column 33: document type does not allow element "object"
> here .
> <object width="410" height="335">
>
> They are saying the last '>' is causing the error.
>
> This is the code:
>
> <script type="text/javascript">
> function showVideo(id) {
> document.getElementById('yt_the_video').innerHTML =
> <object width="410" height="335">
> <param name="movie" value="http://www.youtube.com/v/' + id + '"></param>
> </object>
> }
> </script>
>
>
> Anyone have any suggestions?
>
> Thanks
| |
|
| Hey Murray, That didn't do anything :)
| |
| Mick White 2006-02-07, 10:41 pm |
| Beds wrote:
> Hey Murray, That didn't do anything :)
Not guaranteed to work:
<\/param><\/object>'
Escape the forward slashes. The use of innerHTML like this is flawed.
Mick
| |
|
| Hi Mick,
Thanks for that, you were right it didn't work.
So would there be an alternate way to write this in a way that
validates. I removed 'embed' and the a tag but that pesky '>' causes
failed validation.
All the best
| |
| Mick White 2006-02-07, 10:41 pm |
| Beds wrote:
> Hi Mick,
>
> Thanks for that, you were right it didn't work.
>
> So would there be an alternate way to write this in a way that
> validates. I removed 'embed' and the a tag but that pesky '>' causes
> failed validation.
>
I would use the document DOM:
var Obj=document.createElement("OBJECT");
Obj.width="100";
Obj.height="100";
var Param=document.createElement("PARAM");
Param.name="movie";
Param.value="http://www.youtube.com/v/" + id:
Obj.appendChild(Param)
document.getElementById('yt_the_video').appendChild(Obj);
Something like that. The width and height may be:
Obj.style.width="100px";
Obj.style.height="100px";
Not tested...
Mick
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |