Re: This small piece of code works in Firefox but not in IE 7... why?



I am facing the same problem, if you get the solution can you please
email the same at pranav.kamkhalia@xxxxxxxxxx Appreciate your help.

On Apr 28, 1:02 am, SM <servandomont...@xxxxxxxxx> wrote:
Hello,
How hard could it be to create the embeded youtube object in
JavaScript DOM ? ....
I've create the code and it works ok in Firefox but in IE7 i get an
invalid argument error.

Can someone tell me what im doing wrong?

For reference, this is the embebed youtube video object:
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/dMH0bHeiRNg";></param><param name="wmode"
value="transparent"></param><embed src="http://www.youtube.com/v/
dMH0bHeiRNg" type="application/x-shockwave-flash" wmode="transparent"
width="425" height="350"></embed></object>

This is my attempt to create it using the JavaScript DOM:

function video()
{
var div = document.getElementById("content"); //insert the video in
this div

//create the youtube object
var object1 = document.createElement('object');
object1.setAttribute('width','425');
object1.setAttribute('height','350');

var param1 = ce('param','movie');
param1.setAttribute('value','http://www.youtube.com/v/dMH0bHeiRNg');
object1.appendChild(param1);

var param2 = ce('param','wmode');
param2.setAttribute('value','transparent');
object1.appendChild(param2);

var embed1 = document.createElement('embed');
embed1.setAttribute('width','425');
embed1.setAttribute('height','350');
embed1.setAttribute('wmode','transparent');
embed1.setAttribute('type','application/x-shockwave-flash');
embed1.setAttribute('src','http://www.youtube.com/v/dMH0bHeiRNg');

object1.appendChild(embed1);

div.appendChild(object1); //insert the video

}

function ce(tag,name)
{
if (name && window.ActiveXObject)
{
element = document.createElement('<'+tag+' name="'+name+'">');
}
else
{
element = document.createElement(tag);
element.setAttribute('name',name);
}

return element;

}

Why IE7 gives me an error but Firefox not?

Thanks
Marco


.



Relevant Pages

  • Re: to diminish the time of delay
    ... You would need to use a Windows Media Server, which you should be able to ... I use following script to synchronize the video with slide show and to ... var VDState = 0 ... .asf video/x-ms-asf ...
    (microsoft.public.windowsmedia)
  • Re: to diminish the time of delay
    ... I use following script to synchronize the video with slide show and to ... var VDState = 0 ... ..asf video/x-ms-asf ... If mms:// is pointing to an IIS or Apache server, ...
    (microsoft.public.windowsmedia)
  • This small piece of code works in Firefox but not in IE 7... why?
    ... How hard could it be to create the embeded youtube object in ... This is my attempt to create it using the JavaScript DOM: ... var object1 = document.createElement; ... Why IE7 gives me an error but Firefox not? ...
    (comp.lang.javascript)
  • questions about fb_pan_display ioctl
    ... The FBIOPAN_DISPLAY ioctl does not error-check var. ... How does wrapping work, when fb_pan_display has already made sure that yoffset ... vesafb never uses more than 16mb of video ram, so wrapping can _never_ happen on ...
    (Linux-Kernel)
  • Re: German medical video translation
    ... following video? ... Tanks in advance ... Vargod: ...
    (de.sci.medizin.misc)