Internet Explorer 8 等待页面完全呈现并执行 JavaScript

发布于 2024-09-04 17:28:51 字数 531 浏览 2 评论 0原文

我们有一个相当大的网页,里面有一堆 JavaScript。在 Firefox/Chrome 中加载时,页面会逐渐加载。首先渲染并显示已经接收到的 html,然后执行 javascript。

然而,Internet Explorer 8 会等到完全接收到请求并执行其 javascript 后才会显示。这给人的印象是应用程序在短时间内没有响应。

我们有一台笔记本电脑,IE8 像 Firefox/Chrome 一样加载页面,我们一直在 IE8 上寻找一个设置,以指示它不必等到所有 javascript 执行完毕才显示页面或页面的一部分。

有谁知道是否有这样的设置以及在哪里可以找到它?我们检查了 Internet Explorer 的 Chrome 框架未安装。

更新: 为了获得更多说明,正如 @Thariama 在评论中指出的那样,我还认为 IE8 总是等待渲染整个页面,但看到这台笔记本电脑渲染它,我很确定它加载了“Firefox 方式”。该笔记本电脑的 RAM 和 CPU 功率只有同类台式机的一半,而且看起来和感觉起来都更快(因为渲染)。

We have a pretty big web page with a bunch of javascript. When loading it in Firefox/Chrome, the page gets loaded gradually. First the html that already is received is rendered and shown and then the javascript gets executed.

Internet Explorer 8 however waits until the request is completely received and its javascript executed before it shows. This gives the impression that the application is unresponsive for a short period.

We have one laptop on which IE8 loads the page like Firefox/Chrome and we've been searching for a setting on IE8 to indicate that it doesn't have to wait until all javascript is executed before showing the page or part of it.

Does anyone have a clue if there is such a setting and where it can be found? We checked that the Chrome frame for Internet Explorer is not installed.

Update:
For more clarification, as @Thariama points out in the comments I also thought that IE8 always waits to render the entire page but seeing this laptop render it I am pretty sure that it loads the 'Firefox-way'. The laptop had half the RAM and CPU power a comparable desktop had and it looked and feeled faster (because of the rendering).

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

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

发布评论

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

评论(3

幽梦紫曦~ 2024-09-11 17:28:51

今天,我在尝试确定为什么 IE8 在从本地主机加载时会增量渲染,但在从 Intranet 服务器加载时却不会增量渲染时,遇到了同样的问题。

修复方法是告诉 IE 使用哪个渲染引擎。我更喜欢始终使用最新的可用引擎进行渲染。

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    ...

发生这种情况的原因是,当从本地主机加载时,IE 正在标准模式下使用 IE8 引擎进行渲染。从内网加载时,IE默认使用IE7引擎以兼容模式渲染。 IE7 引擎会暂停,直到整个表格加载完毕后再渲染,但 IE8 引擎会增量渲染表格。

要检查特定页面的 IE 处于哪种模式,请按 F12 调出开发人员工具,菜单区域中的“浏览器模式”会告诉您它选择了哪种渲染引擎,而“文档模式”则表示怪异模式或标准模式。

I ran into the same issue today when trying to determine why IE8 would render incrementally when loading from localhost, but wouldn't when loading from an intranet server.

The fix is to tell IE which rendering engine to use. I prefer to always have it render using the latest engine available.

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    ...

The reason it was happening is because when loading from localhost IE was rendering with the IE8 engine in standards mode. When loading from the intranet, IE defaulted to rendering in compatibility mode using the IE7 engine. The IE7 engine would pause until the whole table was loaded before rendering, but the IE8 engine would render the table incrementally.

To check which mode IE is in for a particular page, hit F12 to pull up the developer tools, and in the menu area there's a "Browser Mode" which tells you which rendering engine it chose, and "Document Mode" which indicates quirks mode or standards mode.

时间你老了 2024-09-11 17:28:51

我最近的任务是解决旧版 Web 应用程序中的 IE8 页面渲染问题(无需更改太多服务器端代码)。我将页面的最大部分包装在 textarea 元素中(在服务器端),并使用 JavaScript 提取其内容,删除 textarea 并在 textarea 所在的位置插入 html...效果很好...甚至看起来在现代浏览器中加载速度更快。

I was recently tasked with resolving an IE8 page rendering issue in a legacy webapp (without changing much server-side code). I wrapped the largest sections of the page in textarea elements (on the server-side) and used JavaScript to extract their contents, remove the textareas and insert the html where the textarea was... it worked out nicely... it even seems to load faster in modern browsers.

踏月而来 2024-09-11 17:28:51

如果人们使用 IE 并且它总是这样做,他们已经习惯了这种“无响应”的想法,每当我打开 IE 检查兼容性时,我只是接受所有页面看起来“无响应”一段时间的事实。

它是 IE 的一部分,生活在无知中的人们已经习惯了,他们不会点击离开。

与其说是解决您的问题,不如说是告诉您这不是一个大问题。我认为没有办法给浏览器指示来为您调整其渲染模型,但也不应该有,用户应该能够调整渲染模型,但不能调整网站。这些东西是病毒的门户。

If people use IE and it always does that, they've gotten used to this 'unresponsive' idea, whenever I zap open IE to check for compatibility, I just accept the fact that all pages look 'unresponsive' for a while.

It's part of IE, people that live in ignorance are used to that, they won't click away.

Not as much a solution to your problem, which is probably not there as telling you it's not that much of a problem. I don't think there is a way to give a browser instructions to adjust its rendering model for you though, and there shouldn't be, users should be able to adjust rendering models though, but not sites. Those things are a gateway to virus.

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