Embedding a flash object using .html() crashes browser

Embedding a flash object using .html() crashes browser

I'm trying to use Jquery to embed a video in the page, like this one from CNBC for example:

  1. <object id="cnbcplayer" height="380" width="400" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" >
  2. <param name="type" value="application/x-shockwave-flash"/>
  3. <param name="allowfullscreen" value="true"/>
  4. <param name="allowscriptaccess" value="always"/>
  5. <param name="quality" value="best"/>
  6. <param name="scale" value="noscale" />
  7. <param name="wmode" value="transparent"/>
  8. <param name="bgcolor" value="#000000"/>
  9. <param name="salign" value="lt"/>
  10. <param name="movie" value="http://plus.cnbc.com/rssvideosearch/action/player/id/1496147998/code/cnbcplayershare"/>
  11. <embed name="cnbcplayer" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" allowscriptaccess="always" bgcolor="#000000" height="380" width="400" quality="best" wmode="transparent" scale="noscale" salign="lt" src="http://plus.cnbc.com/rssvideosearch/action/player/id/1496147998/code/cnbcplayershare" type="application/x-shockwave-flash" />
  12. </object>

I'm sticking the HTML into a variable 'embed' then using:

  1. $('.media-center-show').html(embed);

I wish to construct this HTML using JQuery, however when I run the code it locks up Chrome.

If I get rid of the above line and run

  1. alert(embed);
Then copy and paste the html that is output in the popup dialog, the code runs fine from a HTML file and plays the video.

I'm guessing there is a "proper" way to do what I'm trying to do? There seems to be a gazillion ways to create new elements on a page.

Thanks for any help!