AJAX 与 IFrame

发布于 2024-09-14 11:41:25 字数 177 浏览 1 评论 0原文

我正在从 AJAX get 请求加载纯 HTML 代码,并使用 JQuery 将其附加到 div 中。在 IE 中这个过程相当慢。我使用了多种方法来加快速度,但它对 IE 没有太大影响。

因此,替代方法是通过 IFrame 加载此内容。 Iframe 由浏览器呈现,因此比 AJAX 更快。

你们有什么想法?

I am loading a pure HTML code from a AJAX get request and appends it into a div using JQuery. In IE this process is quite slow. I used several method to speed this up but it does not have a major impact on IE.

So alternative is to load this content via IFrame. Iframe is rendered by browser and hence can be faster as compared to AJAX.

What are your thoughts guys?

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

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

发布评论

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

评论(1

泪之魂 2024-09-21 11:41:25

我建议您检查一下后端准备结果需要多长时间。然后检查客户端得到响应需要多长时间,然后进行比较。将响应附加到 div 时可能会出现延迟。
只有在您进行这些检查之后,才能清楚哪一种更可取。

I would suggest you to check how long takes to prepare result on back end. Then to check how long takes to get response on client and then compare. Probably there is a latency while you appending response into a div.
Only after you will make those checks it could be clear which one is preferable.

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