I'm trying to modify an <object> element dynamically, to add
<param name="wmode" value="transparent">
i'm working with the standard youtube embed:
Code:
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/adsasdrwr=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/adsasdrwr&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>
i've confirmed (with a dom inspector) that the code below adds the param, but apparently you need to remove and then re-create the Object, in order for it to take effect?
Code:
var objParam = document.createElement("param");
objParam.setAttribute('wmode', 'transparent');
objObject.insertBefore(objParam, objObject.firstChild);
(i know <object> is only used in IE, but i used FF's dom inspector.)
to keep this short, removing and then recreating the <object> tag doesn't work in IE. in fact, simply trying to remove the object hs no effect. but it works in FF -- removing the <object> gets rid of the embedded youtube video (the <embed> tag is a child of the <object> tag).
Code:
var objectz = document.getElementsByTagName('object');
for (n = 0; n < objectz.length; n++){
var obj = objectz[n];
var pn = obj.parentNode;
pn.removeChild(obj);
}
this has no effect in IE, and no error is thrown...
any help is much appreciated.