Javascript 使用jQuery设置flash播放器

Javascript 使用jQuery设置flash播放器,javascript,jquery,internet-explorer,internet-explorer-8,Javascript,Jquery,Internet Explorer,Internet Explorer 8,我有一个flash播放器(仅用于不支持html5视频的浏览器),设置如下: <object id="mpl" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300"> <param

我有一个flash播放器(仅用于不支持html5视频的浏览器),设置如下:

<object id="mpl" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300">
    <param name="id" value="mpl" />
    <param name="movie" value="/r/player.swf" />
    <param name="quality" value="high" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
</object>

对于那些需要flash的情况,这就是我尝试动态设置url的方式。它在Chrome中工作,但不是IE8(IE8模式下的IE9),这是我真正需要它工作的地方

我得到的错误是jquery中与append方法对应的行上的“Invalid argument”

IE8想让我用不同的方式来做吗

data.videoPlayerContainer.find("object").append($('<param name="flashvars" value="width=400&height=300&displayheight=300&file=' + encodeURIComponent(flashUrl) + ' &autostart=true&type=flv&bufferlength=10&javascriptid=mpl&enablejs=true" />'));
data.videoPlayerContainer.find("object").append($('<embed src="/r/player.swf" name="mpl" width="400" height="300" bgcolor="#ccc3ad" allowfullscreen="true" allowscriptaccess="always" flashvars="width=400&height=300&displayheight=300&file=' + encodeURIComponent(flashUrl) + '&type=flv&bufferlength=10&showicons=false&shownavigation=false&autostart=true&javascriptid=mpl&enablejs=true" />'));
data.videoPlayerContainer.find(“对象”).append($(“”));
data.videoPlayerContainer.find(“对象”).append($(“”));

查看一下,这将有助于您找到合适的解决方案。

您是否尝试过使用?因此,您认为错误来自此较旧的flash对象?哪个不能很好地处理动态添加的内容?可能,但swfobject应该可以帮助您解决交叉浏览器问题。