不使用IFrame的原因? [英] Reasons for not using IFrame?

查看:90
本文介绍了不使用IFrame的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么理由根本不使用iframe?我目前使用它从其他服务器加载页面(注册页面-分布式应用程序的一部分),以提供无缝的体验.使用iframe是否被认为是不好的做法,还是可以使用?

are there any reasons not to use iframes at all? I currently use it to load a page from a different server (a sign up page - part of a distributed application) to provide a seamless experience. Is using iframes considered bad practice or is its use OK?

推荐答案

iframe是一个很好的工具.它享有几乎通用的浏览器支持,易于实现并且具有许多有用的功能.与其他任何HTML元素一样,它也可以被滥用,但是巧妙地使用它可以在可靠的用户界面中发挥作用.

The iframe is a great tool. It enjoys near-universal browser support, it's easy to implement and has a number of useful functions. As with any other HTML element, it can be abused, but wielded intelligently it can play a part in a solid UI.

一些开发人员可能会争辩说使用AJAX来代替,在某些情况下这也许是更合适的方法,但是AJAX不是灵丹妙药,而iframe可以是更简单的实现,并且对用户具有相同的最终结果.首先要做最简单的事情,只有当您可以验证不起作用的原因和原因时,才进行更改.

Some developers might argue to use AJAX instead, and in some situations that may be the more appropriate approach, but AJAX is not a panacea and iframes can be a far simpler implementation which has the same end-result for your users. Do whatever is simplest first, and only change that when you can verify how and why that is not working.

这篇关于不使用IFrame的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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