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

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

问题描述

可能的重复:
iframe 是否被视为不良做法"?

在与 Web 开发人员合作时,我总是听到他们说使用 iframe 是我们必须尽可能避免的事情,有些人说它很糟糕,很烦人,会带来很多问题.

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.

还有一天,当我告诉我的前任不是开发人员"我将使用 iframe 时,他认为我是一个糟糕的开发人员 :)

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 :)

我想知道的是,iframe 在 Web 开发方面的历史很糟糕吗?

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

这是一场灾难吗?

在某些情况下,我发现必须使用 iframe,这是否意味着我是一个糟糕的开发人员?

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.

推荐答案

Iframe 可能存在与框架类似的问题以及对 XMLHttpRequest 使用不当的问题:它们打破了一个文档每个 URL 的范式,对网络的正常运行至关重要(想想书签、深层链接、搜索引擎等).

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, ...).

如果您正在创建 Web 应用程序,请使用您想要的任何技术(包括框架、Flash、小程序、$ 任何内容).如果您正在创建一个实际的信息网页,请坚持使用无框架 HTML、CSS 和不引人注目的 JavaScript,并记住该页面在禁用脚本的情况下仍然可以使用.

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天全站免登陆