为什么开发人员讨厌iframe? [英] Why developers hate iframes?

查看:86
本文介绍了为什么开发人员讨厌iframe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

iframe是否被认为是坏习惯?


对于网站开发人员,我总是听到他们说使用iframe是我们必须尽量避免的,有些人说这是不好的,令人讨厌的,并带来很多问题。



当我告诉我以前的老板不是开发者时,有一天我会使用iframe,他看着我是一个糟糕的开发者:)



我想要的是什么知道,iframes有一个非常糟糕的历史与web开发?



这是一场灾难吗?



我发现这是必须使用iframe,是说这意味着我是一个糟糕的开发人员?



或者所有这些因为它很难处理我们在开发过程中必须考虑的安全问题?

请求e如果你讨厌它,请列出你的观点,或者如果我错误地思考,请纠正我的观点。

解决方案

iframes can have similar issues作为框架并不恰当地使用 XMLHttpRequest :它们打破了单一URL的范例,这对网络的正常运行至关重要(思考书签,深层链接,搜索引擎,...)。



如果你正在创建一个web应用程序,可以使用你想要的任何技术(包括框架,flash,applets,$ whatever) 。如果您正在创建一个实际的,信息性的网页,请坚持使用无框架的HTML,CSS和简洁的JavaScript,并牢记该页面仍然可以在禁用脚本的情况下使用。


Possible Duplicate:
Are iframes considered 'bad practice'?

While working with web developers, I always hear from them that using iframes is something we must avoid as we can, and some say it's something bad, annoying and makes a lot of problems.

Also when i told my previous boss "not a developer" one day that i will use iframe, he looked at me as a bad developer :)

What i want to know, does iframes have a very bad history with web development?

Is it a disaster?

In some cases I see that it's a must to use iframes, is saying that means I am a bad developer?

Or all of that because of it's hard to deal with because of some security issues we must take care about while developing?

Please list your points if you hate it too or correct me if I am thinking the wrong way.

解决方案

Iframes can have similar issues as frames and inconsiderate use of XMLHttpRequest: They break the one-document-per-URL paradigm, which is essential for the proper functioning of the web (think bookmarks, deep-links, search engines, ...).

If you're creating a web application, use whatever technique you want to (including frames, flash, applets, $whatever). If you're creating an actual, informational web page, stick to frameless HTML, CSS and unobstrusive JavaScripts and keep in mind that the page should still be usable with scripting disabled.

这篇关于为什么开发人员讨厌iframe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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