通过jQuery改变对象嵌入源 [英] Changing object embed source via jquery

查看:152
本文介绍了通过jQuery改变对象嵌入源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够加载不同的Flash文件,当用户点击我的gallary图像。我目前的解决方案在Firefox中工作得很好,但是Chrome和IE不能正常工作,也没有提供任何错误信息。我使用jQuery来改变嵌入源码。

/ p>

  $('#flash embed')。attr('src',msg.d); 


< object id =flash>
< embed src =type =application / x-shockwave-flashwidth =800height =600>< / embed>
< / object>


解决方案

我找到了一些解决方案。我结束了使用第二个。



方法1:
动态嵌入整个对象选项卡。方法2:
我发现了一个jQuery的Flashloader插件,它是简单的使用和运作良好。
http://jquery.lukelutman.com/plugins/flash/

方法3
使用jquery swfObject
http://jquery.thewikies.com/swfobject/examples


I need to be able to load up different flash files when users click an image in my gallary. My current solution works perfectly fine in Firefox, but Chrome and IE are not working and it isn't giving any error messages.

I use jquery to change the embed source

$('#flash embed').attr('src', msg.d);


  <object id="flash">
                <embed src="" type="application/x-shockwave-flash" width="800" height="600"></embed>
  </object>

解决方案

I found a few solutions. I ended up using the second one.

Method 1: I insert the entire object tab with embed dynamically. That seems to fix flash loading issues in Chrome and IE.

Method 2: I found a jquery flashloader plugin that is simple to use and works well. http://jquery.lukelutman.com/plugins/flash/

Method 3 Use jquery swfObject http://jquery.thewikies.com/swfobject/examples

这篇关于通过jQuery改变对象嵌入源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆