Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

javascript - a script on this page is causing ie to run slowly

The problem is in the title - IE is misbehaving and is saying that there is a script running slowly - FF and Chrome don't have this problem.

How can I find the problem . .there's a lot of JS on that page. Checking by hand is not a good ideea

EDIT : It's a page from a project i'm working on... but I need a tool to find the problem.

End : It turned out to be the UpdatePanel - somehow it would get "confused" and would take too long to process something. I just threw it out the window - will only use JQuery from now on :D.

And I'm selecting Remy Sharp's answere because I really didn't know about the tool and it seems pretty cool.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Long running scripts are detected differently by different browsers:

  • IE will raise the warning once 5 million statements have been executed (more info on MSDN)
  • Firefox will warn if the script takes longer than 10 seconds (more info on MDN)
  • Safari will warn if the script takes longer than 5 seconds
  • Chrome (1.0) has no set limit and will simply keep trying until an OutOfMemory exception at which point it crashes
  • Opera will just continue to run forever, without warning.

Nicholas Zakas has written an excellent article covering this topic.

As such - the best way to avoid these problems is by reducing looping, recursion and DOM manipulation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...