开发者

Jquery/PHP script too heavy for browser: overcome browser limitations?

I've been working on a text comparison gizmo and it's proven ok until one of my texts was very very very long... Then I got this dreadful message f开发者_运维知识库rom the browser: script too slow. What does this mean? Is my browser buffer overflown? Are my computer / system resources exhausted? Is there a way I can either compress / gzip / minify my script or overcome the browser limitations? Thanks in advance for your thoughts.


This message is generated, when script last too long, without passing control back to browser. It will this way block user interface. You should decompose your work into piecies, lasting not longer than a few seconds, and after each add next part to queue using setTimeout. I've came across this problem in very heavy GWT-based application. Decomposing the work got rid of that message.


Compressing the representation of the code won't fix the problem, which is that the JavaScript code uses too many resources (CPU/memory) when running. To fix this, move the heavy lifting to the server-side code instead of running it in the browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜