SWF对象 - 为什么我应该使用它 [英] SWF object - why should I use it

查看:157
本文介绍了SWF对象 - 为什么我应该使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有我的网站都需要搜索引擎友好 - 即搜索引擎可读。然而,我喜欢闪光,并希望以友好的方式整合它。

我可以选择swfobject,它允许适当的页面名称和服务不同的页面用户与搜索引擎。

然而,我想知道为什么会有需要使用swfobject。例如,我可以使用普通的php cms页面并插入flash元素。当页面被搜索引擎调用时,只需提供纯html,而用户将得到flash。



我真的很感激找到其他点查看这个主题和不同方法的好处。

非常感谢

K

$首先,你必须编写的嵌入swf文件的html代码对于某些浏览器是不同的。

解决方案


Firefox,Chrome,..使用< object> 标记,而IE使用< embed> tags。

SWFObject是一个JavaScript库(有点愚蠢,因为它只有一个文件:P),可以直接将适当的html标签注入到DOM树,并为您处理这些浏览器的差异。



此外,还有一些安全问题。我知道一个事实,在旧的Flex Builder版本中,有 SWFObject默认为创建html包装文件。



所以,要回答你的问题:

是否真的有必要?不,如果你知道你在做什么的话。
是否方便,是Adobe的标准,是的。


干杯


All my sites need to be search engine friendly - ie readable by search engines. However, I kind of like flash and would like to integrate it in a friendly way.

I have the option of swfobject, which allows proper page names and serves different pages to the user vs search engine.

However, I am wondering why there would be a need to use swfobject. For instance, I could just use a normal php cms page and insert flash elements into it. When the page is called by a search engine, just serve the pure html, whereas a user would get the flash.

I'd really appreciate to find out other points of view on this subject and the benefits of the different approaches.

Many thanks

K

解决方案

First of all, the html code you have to write to embed an swf file is different for some browsers.

Firefox, Chrome, .. use <object> tags while IE uses <embed> tags.

SWFObject is a javascript 'library' (kinda silly since it is only one file :P) that can inject the proper html tags directly into the DOM tree, and handles those browser differences for you.

Furthermore there were some security concerns for flash cross site scriptings attacks in the past.

I know for a fact that in older Flex Builder versions there were problems with the generated html-templates which could potentially cause major security issues.

Nowadays in newer versions of Flash Builder, Adobe uses SWFObject by default to create html wrapper files.

So, to answer your question:

Is it really necessary? No, it's not if you know what you are doing. Is it convenient and an Adobe standard, yes it is.

Cheers

这篇关于SWF对象 - 为什么我应该使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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