Albert's 实践记录
Java、Perl、Shell、& ……
posts - 0,  comments - 0,  trackbacks - 0
今天有一个项目上线测试,发现很多页面在IE下报错,出错的意思大概都是“null为空或不是对像”,使用IE的调试工具调试了一下,出错的位置为:

try { document.getElementById("").SetReturnValue(__flash__toXML(document.location.protocol.valueOf()) ) ); } catch (e) { document.getElementById("").SetReturnValue("<undefined/>"); }

原因应该是document.getElementById("")获取不到内容,由于大部分页面都使用<object/>标签嵌入了一个Flash,而且<object/>标签内没有id属性,于是在<object/>标签里添加一个id,问题解决了。

对于在页面里嵌入Flash,更常见的做法是使用SWFObject,转一篇SWFObject的官方文档(http://code.google.com/p/swfobject/wiki/documentation),中文

What is SWFObject?

SWFObject 2:

Why should you use SWFObject?

SWFObject 2:

The A List Apart article Flash Embedding Cage Match describes the full rationale behind SWFObject 2.

Why does SWFObject use JavaScript?

SWFObject 2 primarily uses JavaScript to overcome issues that cannot be solved by markup alone; it:

Should I use the static or dynamic publishing method?

SWFObject 2 offers two distinct methods to embed Flash Player content:

  1. The static publishing method embeds both Flash content and alternative content using standards compliant markup, and uses JavaScript to resolve the issues that markup alone cannot solve
  2. The dynamic publishing method is based on marked up alternative content and uses JavaScript to replace this content with Flash content if the minimal Flash Player version is installed and enough JavaScript support is available (similar like previous versions of SWFObject and UFO)

The advantages of the static publishing method are:

  1. The actual authoring of standards compliant markup is promoted
  2. Best embed performance
  3. The mechanism of embedding Flash content does not rely on a scripting language, so your Flash content can reach a significant bigger audience:

The advantages of the dynamic publishing method are:

  1. It integrates very well with scripted applications and enables the use of dynamic variables (flashvars)
  2. It avoids click-to-activate mechanisms to activate active content in Internet Explorer 6/7 and Opera 9+. Please note that Microsoft has phased out most active content from its Internet Explorer browsers

posted on 2009-10-20 17:31 ouxingning 阅读(506) 评论(0)  编辑  收藏 所属分类: Web

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问  
 

<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

留言簿

文章分类

文章档案

搜索

  •  

最新评论