Hi, I have tried the code you provided. Like:

//sightly revised
var count = 0;
var _fn = function() { count++; _fn1(); };
var _fn1 = function() { count++; _fn(); };
try {
  _fn();


} catch (ex) {
        alert(ex.description || ex);
        alert( "Stack overflow at " + count + " recursions" );
}

Interestingly, my IE reports "at 1126 recursions" and Firefox does
exactly "at 1000 recursions". Both are contant no matter two functions
invoke alternately or a single one invoke itself. I suspect that, in
IE, the '1126' varies according to the specific machine but Firefox
keeps a fixed scheme. Besides, the 'ex' throwed is very the "Stack
overflow"(The text showed is in my local language, which means that),
and firefox reports it as "Internal error: too much recursion".

>If you have a stack overflow, do not use setTimeout ! Find out why your script
>throw this exception.

Yes. However, my problem is that IE automatically reports the error
"stack overflow at line 0" (notice that it is at "line 0", which part
of my code is at line 0? And it is not alerted using try-catch and
alert(), purely automatically pops out. Also, it is showed in English,
not in my local language like above.). Moreover, it is strange that it
happens only sometimes, though most of the time it is ok. I have no
means to know which time the error will occur and to debug a program
which often executes properly. Aonther point is that when my program
was very small, the error had never occurred, but when it growed into
a considerable large scale, the error came sometimes. It is so
boresome that I can only ascribe it to IE's bugs since in Firefox it
never happens.

That is the reason why I suspect function stack has relationship with
my problem and wish setTimeout can solve it. It seems going off our
topic. Lastly, if anybody could please provide any suggestion for my
problem, I will be very grateful. Thanks anyway!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to