简体   繁体   English

使用iframe进行ajax长轮询有什么好处?

[英]What are the benefits to using iframes for ajax long polling?

What are the benefits of using iframes for Comet long polling? 使用iframe进行Comet长轮询有什么好处? Why not just keep an asynchronous ajax request in a script file pulled into the main page? 为什么不将脚本文件中的异步ajax请求保存到主页面? Thanks. 谢谢。

It makes portability to IE possible: http://softwareas.com/portable-comet-its-the-iframe-stupid 它使IE的可移植成为可能: http//softwareas.com/portable-comet-its-the-if​​rame-stupid

Also, some people use it as a security feature. 此外,有些人将其用作安全功能。 Within an iFrame you can enclose everything within a JavaScript closure and improve your security. 在iFrame中,您可以将所有内容都包含在JavaScript闭包中并提高安全性。 There are better ideas for security though. 但是有更好的安全思想。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM