"A script on this page may be busy"

P

Philipp Lenssen

Using Firefox and this Reversi script
http://gamesforthebrain.com/game/reversi/ , I often get "A script on
this page may be busy ..." warning message. I suspect to be the
recursive min-max algorithm which takes too long in "Medium" mode -- it
never happens in "Easy" mode.

Is there anything I may try tweaking in the JS so users won't see this
somewhat annoying message?
 
M

Martin Honnen

Philipp said:
Using Firefox and this Reversi script
http://gamesforthebrain.com/game/reversi/ , I often get "A script on
this page may be busy ..." warning message. I suspect to be the
recursive min-max algorithm which takes too long in "Medium" mode -- it
never happens in "Easy" mode.

Is there anything I may try tweaking in the JS so users won't see this
somewhat annoying message?

Mozilla's JavaScript debugger Venkman allows you to profile scripts so
that can be an approach to find out where your script spends (too) much
time.
In general if a script in a loop or recursion causes the script engine
to give such a warning then with client-side script one approach is to
try to break up the loop or recursion with different script blocks
calling each other with setTimeout or setInterval.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top