Strange problem with form.submit() on FF and stack overflow

S

szimek

Hi,

I've already posted an email with this problem, but this time I think
I got a bit more info.

The app I'm currently working on works like this: when user clicks on
a clickable element, it handles its onclick event and sets values of
input fields in hidden form according to event data etc. The form is
submitted, on the server side there's some javascript generated that
is injected into a hidden frame (the same where the hidden form is)
and reloaded. Thus the generated javascript is executed and some
action is performed.

It works fine on IE.

On Opera it seems to work (something happens after clicking the
buttons). However, there's another problem - when the whole page is
loaded (not after clicking the button), I get the following error
"Event thread: load. ECMAScript interpreter stack overflow." twice. I
guess it's bad, but I have no idea how to fix it and I'm not sure if
it's related to the problem that happens on FF.

On FF despite the fact that it executes "form.submit()" (I'm using
Firebug 1.1b10 to step through the code) nothing is actually sent to
the server (I checked it using LiveHTTPHeaders plugin). The js is not
generated, the frame is not reloaded and the whole page simply hangs.

I've debugged js code in IE and FF step by step and they seem to work
exactly the same. The form seems to be exactly the same. I have really
no idea what can be wrong. Any ideas?

Thanks in advance for any suggestions!
 
J

Jeremy J Starcher

Hi,

I've already posted an email with this problem, but this time I think I
got a bit more info.

Afraid we'll need a bit more info. A sample of the most minimal case
that causes the problem.
On Opera it seems to work (something happens after clicking the
buttons). However, there's another problem - when the whole page is
loaded (not after clicking the button), I get the following error "Event
thread: load. ECMAScript interpreter stack overflow."

Possible (most likely?) cause -- too much recursion. Having a function
that calls itself over and over.
On FF despite [snip] the frame is not reloaded and the whole page
simply hangs.

Again, possibly recursion as well. Don't know what size stack any of the
browsers use.
 
S

szimek

I've already posted an email with this problem, but this time I think I
got a bit more info.

Afraid we'll need a bit more info.  A sample of the most minimal case
that causes the problem.
On Opera it seems to work (something happens after clicking the
buttons). However, there's another problem - when the whole page is
loaded (not after clicking the button), I get the following error "Event
thread: load. ECMAScript interpreter stack overflow."

Possible (most likely?) cause -- too much recursion.  Having a function
that calls itself over and over.
On FF despite [snip] the frame is not reloaded and the whole page

simply hangs.

Again, possibly recursion as well.  Don't know what size stack any of the
browsers use.

I thought that maybe there's something wrong with the form, so I used
WireShark to check if POST request is actually sent.

In FF I step through the code from the onclick event handler in the
button to the form.submit(); line. There are no errors, but there's no
POST request as well. Trying to submit the form from Firebug console
using typing form.submit(); also doesn't send any POST request.

The form is in a frame, I opened the frame directly in the browser.
Clicking submit button sends a POST request. Typing form.submit(); in
Firebug console sends a POST request.

Additionally I somehow got rid of stack overflow errors in Opera -
probably by removing all alerts and debugger keywords :)

I know it's not much info here, but if anyone has any idea what can be
wrong or how to further investigate this problem I'd be really
grateful.
 
S

szimek

Afraid we'll need a bit more info.  A sample of the most minimal case
that causes the problem.
Possible (most likely?) cause -- too much recursion.  Having a function
that calls itself over and over.
On FF despite [snip] the frame is not reloaded and the whole page
simply hangs.
Again, possibly recursion as well.  Don't know what size stack any of the
browsers use.

I thought that maybe there's something wrong with the form, so I used
WireShark to check if POST request is actually sent.

In FF I step through the code from the onclick event handler in the
button to the form.submit(); line. There are no errors, but there's no
POST request as well. Trying to submit the form from Firebug console
using typing form.submit(); also doesn't send any POST request.

The form is in a frame, I opened the frame directly in the browser.
Clicking submit button sends a POST request. Typing form.submit(); in
Firebug console sends a POST request.

Additionally I somehow got rid of stack overflow errors in Opera -
probably by removing all alerts and debugger keywords :)

I know it's not much info here, but if anyone has any idea what can be
wrong or how to further investigate this problem I'd be really
grateful.

Problem partially solved. It works in the latest FF 3 beta (POST
request is sent), so I can further debug with Firebug.
 
T

Thomas 'PointedEars' Lahn

szimek said:
Problem partially solved. It works in the latest FF 3 beta (POST
request is sent), so I can further debug with Firebug.

Testing code for production quality with beta versions is a recipe
for disaster.


PointedEars
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top