468,768 Members | 1,702 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,768 developers. It's quick & easy.

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

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!
Feb 14 '08 #1
4 2070
On Thu, 14 Feb 2008 08:09:26 -0800, szimek wrote:
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.

Feb 14 '08 #2
On 14 Lut, 19:33, Jeremy J Starcher <r3...@yahoo.comwrote:
On Thu, 14 Feb 2008 08:09:26 -0800, szimek wrote:
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.
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.
Feb 15 '08 #3
On 15 Lut, 15:22, szimek <szi...@gmail.comwrote:
On 14 Lut, 19:33, Jeremy J Starcher <r3...@yahoo.comwrote:
On Thu, 14 Feb 2008 08:09:26 -0800, szimek wrote:
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.

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.
Feb 15 '08 #4
szimek wrote:
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
Feb 17 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Travis Pupkin | last post: by
2 posts views Thread by David W. Walker | last post: by
2 posts views Thread by COHENMARVIN | last post: by
11 posts views Thread by Martin Joergensen | last post: by
13 posts views Thread by tomy | last post: by
7 posts views Thread by amit.atray | last post: by
2 posts views Thread by swethak | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.