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:
- <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" >
- <param name="type" value="application/x-shockwave-flash"/>
- <param name="allowfullscreen" value="true"/>
- <param name="allowscriptaccess" value="always"/>
- <param name="quality" value="best"/>
- <param name="scale" value="noscale" />
- <param name="wmode" value="transparent"/>
- <param name="bgcolor" value="#000000"/>
- <param name="salign" value="lt"/>
- <param name="movie" value="http://plus.cnbc.com/rssvideosearch/action/player/id/1496147998/code/cnbcplayershare"/>
- <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" />
- </object>
I'm sticking the HTML into a variable 'embed' then using:
- $('.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
- 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!