# Need help inserting flash \<object\> tag using innerHTML

**URL:** <https://forum.kirupa.com/t/need-help-inserting-flash-object-tag-using-innerhtml/219330>\
**Category:** web dev\
**Created:** [March 15, 2007, 6:21pm UTC](https://forum.kirupa.com/t/need-help-inserting-flash-object-tag-using-innerhtml/219330 "2007-03-15T18:21:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashNewby](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@FlashNewby](https://forum.kirupa.com/u/FlashNewby)\
**Post date:** [March 15, 2007, 6:21pm UTC](https://forum.kirupa.com/t/need-help-inserting-flash-object-tag-using-innerhtml/219330/1 "2007-03-15T18:21:26Z")

</div>

Hello all,

I have a dropdown box that when a selection is made, I want to display a flash swf file using innerHTML. Currently for testing purposes I have hard coded the flash \<object\> to a javascript variable. I can get the flash swf to load but the flash is not displaying. Can someone help with this. Here is the code(i.e. I have some ajax code in here as well but). The\*\* fls \*\*variable is what holds the string of flash code to be embedded in the innerHTML and pollban is my div that will hold the flash. Can someone tell me why the flash doesn’t display.

**HTML Code:**

```auto
 <DIV id="pollban" align="center"></DIV> 

```

Thanks

**Javascript Code:**

```auto

function getPollUrl(sel)
{
    var pollType = sel.options[sel.selectedIndex].value;
    var callback = displayPoll;
    executeXhr(callback, pollType);
    document.getElementById("pollban").style.height = "500px";
 
 var fls = 
  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+
'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="190" height="360" id="acuradealers" align="middle">'+
'<param name="allowScriptAccess" value="sameDomain"/>'+
'<param name="movie" value="[http://www.aloadofdallas.com/quickpoll/auto/acuradealers/acuradealers.swf"/>'](http://www.aloadofdallas.com/quickpoll/auto/acuradealers/acuradealers.swf&quot;/>')+
'<param name="quality" value="high"/>'+
'<param name="bgcolor" value="#ffffff" />'+
'<embed src="http://www.aloadofdallas.com/quickpoll/auto/acuradealers/acuradealers.swf" quality="high" bgcolor="#ffffff" width="190" height="360" name="acuradealers" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
'</object>';
 document.getElementById("pollban").innerHTML = fls;
 //ajax.onCompletion = displayPoll;
}

```
