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

发布于 2024-08-19 17:49:49 字数 68 浏览 5 评论 0原文

使用 iframe 进行 Comet 长轮询有什么好处?为什么不将异步 ajax 请求保留在拉入主页的脚本文件中呢?谢谢。

What are the benefits of using iframes for Comet long polling? Why not just keep an asynchronous ajax request in a script file pulled into the main page? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唔猫 2024-08-26 17:49:49

它使 IE 的可移植性成为可能:
http://softwareas.com/portable-comet-its-the-if​​rame-愚蠢

此外,有些人将其用作安全功能。在 iFrame 中,您可以将所有内容包含在 JavaScript 闭包中并提高安全性。不过,对于安全性还有更好的想法。

It makes portability to IE possible:
http://softwareas.com/portable-comet-its-the-iframe-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. There are better ideas for security though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文