bigmtnskier
April 30th, 2006, 01:21 PM
Hi there,
Do any of you know what is wrong with the following code? It works just fine in Firefox but wonderful IE throws the error "Invalid Argument." I have narrowed it down to the very last line in the code segment below. Does IE not like adding <embed> tags programmatically using document.createElement? Are there any alternatives I could use?
What I am pretty much trying to do is add a an <embed> inside an <object> inside a <div>. As said earlier, It works fine in FF but IE has troubles with it.
var objLightboxImage = document.createElement("object");
objLightboxImage.setAttribute('id','lightboxImage' );
objLightboxImage.setAttribute('classid','clsid:D27 CDB6E-AE6D-11cf-96B8-444553540000');
objLightboxImage.setAttribute('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0');
objLightboxImage.setAttribute('width','550');
objLightboxImage.setAttribute('height','400');
var Param1 = document.createElement("param");
Param1.setAttribute('name','movie');
Param1.setAttribute('value','never');
var Param2 = document.createElement("param");
Param2.setAttribute('name','quality');
Param2.setAttribute('value','high');
var Embed = document.createElement("embed");
Embed.setAttribute("quality", "high");
Embed.setAttribute("width", "550");
Embed.setAttribute("height", "400");
Embed.setAttribute("align", "center");
Embed.setAttribute("type", "application/x-shockwave-flash");
Embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
Embed.setAttribute('id','lightboxImageEmbed');
objLightboxImage.appendChild(Param1);
objLightboxImage.appendChild(Param2);
//IE DOESN'T LIKE THIS LINE BELOW...
//If i add "return false" here there aren't any errors
objLightboxImage.appendChild(Embed);
//If i add it here however, IE says "Invalid Argument"
Thanks in advance :hugegrin:
-bigmtnskier
(ps. If you need more of the code, just ask and I'll post it)
Do any of you know what is wrong with the following code? It works just fine in Firefox but wonderful IE throws the error "Invalid Argument." I have narrowed it down to the very last line in the code segment below. Does IE not like adding <embed> tags programmatically using document.createElement? Are there any alternatives I could use?
What I am pretty much trying to do is add a an <embed> inside an <object> inside a <div>. As said earlier, It works fine in FF but IE has troubles with it.
var objLightboxImage = document.createElement("object");
objLightboxImage.setAttribute('id','lightboxImage' );
objLightboxImage.setAttribute('classid','clsid:D27 CDB6E-AE6D-11cf-96B8-444553540000');
objLightboxImage.setAttribute('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0');
objLightboxImage.setAttribute('width','550');
objLightboxImage.setAttribute('height','400');
var Param1 = document.createElement("param");
Param1.setAttribute('name','movie');
Param1.setAttribute('value','never');
var Param2 = document.createElement("param");
Param2.setAttribute('name','quality');
Param2.setAttribute('value','high');
var Embed = document.createElement("embed");
Embed.setAttribute("quality", "high");
Embed.setAttribute("width", "550");
Embed.setAttribute("height", "400");
Embed.setAttribute("align", "center");
Embed.setAttribute("type", "application/x-shockwave-flash");
Embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
Embed.setAttribute('id','lightboxImageEmbed');
objLightboxImage.appendChild(Param1);
objLightboxImage.appendChild(Param2);
//IE DOESN'T LIKE THIS LINE BELOW...
//If i add "return false" here there aren't any errors
objLightboxImage.appendChild(Embed);
//If i add it here however, IE says "Invalid Argument"
Thanks in advance :hugegrin:
-bigmtnskier
(ps. If you need more of the code, just ask and I'll post it)