如何防止“此页面上的脚本导致Internet Explorer运行缓慢”没有更改注册表中的MaxScriptStatements? [英] How to prevent "A script on this page is causing Internet Explorer to run slowly" without changing MaxScriptStatements in the registry?

查看:202
本文介绍了如何防止“此页面上的脚本导致Internet Explorer运行缓慢”没有更改注册表中的MaxScriptStatements?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Bing和/或Google javascript地图控件,有时会使用大量动态可更改的叠加层。

We are using Bing and/or Google javascript map controls, sometimes with large numbers of dynamically alterable overlays.

我已阅读 http://support.microsoft.com/kb/175500/en-us 并知道如何设置MaxScriptStatments注册表项。

I have read http://support.microsoft.com/kb/175500/en-us and know how to set the MaxScriptStatments registry key.

问题是我们不希望以编程方式在用户的计算机上设置此密钥或任何其他注册表项,而是希望以其他方式实现相同的效果。

Problem is we do not want to programmatically set this or any other registry key on users' computers but would rather achieve the same effect some other way.

还有另外一种方法吗?

推荐答案

除了制作之外你几乎无能为力你的脚本更轻。尝试对其进行分析并找出发生最重的运算的位置,然后尝试优化这些部分,将它们分解为更小的组件,在前一个组件完成后用超时调用下一个组件,依此类推。基本上,每隔一段时间就将控件交还给浏览器,不要在一个函数调用中处理所有内容。

Hardly anything you can do besides making your script "lighter". Try to profile it and figure out where the heaviest crunching takes place, then try to optimize those parts, break them down into smaller components, call the next component with a timeout after the previous one has finished and so on. Basically, give the control back to the browser every once in a while, don't crunch everything in one function call.

这篇关于如何防止“此页面上的脚本导致Internet Explorer运行缓慢”没有更改注册表中的MaxScriptStatements?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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