[文章作者:张宴 本文版本:v1.0 最后修改:2007.04.15 转载请注明出处:http://blog.zyan.cc]

  微软因为一项专利侵权案,更改了IE浏览器中的ActiveX控件,只要Windows自动更新安装了微软的KB912945补丁后(或者安装IE7后),凡是一个页面内使用<object>、<embed>或<applet>标签的活动内容都不会被自动激活,需要用户手动点击,因而flash控件也不能幸免。下图为腾讯首页的一个Flash,各大门户网站只有腾讯的Flash控件没有进行激活处理:

  点击在新窗口中浏览此图片

  目前只能通过修改网页来解决激活问题微软官方给出的自动激活方法是:使用<script type="text/javascript" src="abc.js"></script>的方式调用外部的JS文件,在JS文件中用使用docuemnt.write写<object>...</object>。注意:直接在页面上使用docuemnt.write写入是不能饶开激活限制的。


  我在自己的博客上采用了Unobtrusive Flash Objects (UFO)方案,首先在<head></head>中调用:
引用
<script type="text/javascript" src="http://www.zyan.cc/x/blog/200704/ufo.js"></script>

  然后在需要插入Flash的地方插入以下代码:
引用
<script type="text/javascript">var FO = { movie:"http://v.blog.sina.com.cn/swf/player.swf?vid=1783929&uid=1278987704&auto=0", width:"475", height:"447", majorversion:"8", build:"0", xi:"true", quality:"high", bgcolor:"#EAEFF0" };UFO.create(FO, "v20070325-1");</script><div id="v20070325-1"></div>

  注意:红色部分为flash文件地址。两个黄色标注的v20070325-1是随便设定的ID,两两对应,如果一个页面有多个Flash时,不同的Flash需要设定不同的两两对应ID。很多博客支持HTML代码,但提交文章时会在每行代码后加上<BR>换行符,导致Javascript代码出错,以上代码在浏览器中显示有三行,其实并没有换行,因而插在支持HTML的博客中不会出错。
  演示:http://blog.zyan.cc/read.php/217.htm


  还有一些公司、组织和个人提供了解决方案,列表如下:

  1、SWFObject: Javascript Flash Player detection and embed script(新浪、搜狐采用)
  网址:http://blog.deconcept.com/swfobject/

  2、Adobe公司:Active Content Update Article
  网址:http://www.adobe.com/devnet/activecontent/articles/devletter.html

  3、Unobtrusive Flash Objects (UFO)(本博客采用)
  网址:http://www.bobbyvandersluis.com/ufo/

  4、ObjectSwap: Bypassing the ActiveX Activation Issue in IE
  网址:http://www.sitepoint.com/article/activex-activation-issue-ie
  说明:ObjectSwap只需要在<head></head>中引入一个脚本。其逻辑是在页面加载完成后,重写一次标签来实现自动激活,页面中的flash依然是标准的HTML,不需要通过document.write写入。不过兼容性不太好。

  5、objectSwap_lite.js(淘宝网根据ObjectSwap修改的版本,比原版好用)
  说明:首先在<head></head>中引入以下脚本:
引用
<script type="text/javascript" src="http://www.taobao.com/home/js/objectSwap_lite.js?t=20070122" defer="defer"></script>

  接下来可以查看http://www.taobao.com的HTML原文件,查找“<object”,看看他们是怎么写的。




技术大类 » PHP/JS/Shell | 评论(29) | 引用(0) | 阅读(32723)
shz Email
2022-7-29 00:06
Always so interesting to visit your site.What a great info, thank you for sharing. this will help me so much in my learning  Lead generation
shzz Email
2022-7-29 00:08
Super site! I am Loving it!! Will return once more, Im taking your food likewise, Thanks.  Lead generation
shz Email
2022-7-29 00:09
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..  Lead generation
shzz Email
2022-7-29 00:11
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks  Lead generation
shz Email
2022-7-29 00:12
I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject?  Lead generation
shz Email
2022-7-29 00:15
That is very helpful for increasing my knowledge in this field.  Lead generation
shz Email
2022-7-29 00:19
A debt of gratitude is in order for giving late reports with respect to the worry, I anticipate read more.  Lead generation
메이저놀이터 Email
2022-12-5 15:37
What a great article, this is the most useful idea for me. However, there is something missing, but fortunatley, I have it, and you should find here 메이저놀이터
Lucky cola
2024-2-7 16:45
Dive into a world of endless fun and adventure.  Lucky cola
分页: 2/2 第一页 上页 1 2 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]