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

  微软因为一项专利侵权案,更改了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.s135.com/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.s135.com/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 | 评论(2) | 引用(0) | 阅读(9969)
littlehz
2007-5-16 21:48
请问一下,用原来的<object>插入Flash文件,可以设置Flash透明显示<param name="WMode" value="Transparent" />,而用UFO方案该怎么让Flash透明方式显示呢?
louis vuitton uk Email Homepage
2011-11-22 17:34
This louis vuitton uk for sale belongs to the sounding just what are termed as Louis Vuitton vintage best sellers, many other products and services for the reason that range appearing companies.You will easily notice the unfold zippers of this coach outlet store online. That is the decoration. There are some inside pockets for you as well. They are easy to match your clothes and to carry.Let us inspire your inner beauty with fine christian louboutin sale. Purse the elegance in bridal wedding. Enjoy the fashion.
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]