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

Discussion in 'Javascript' started by szimek, Feb 14, 2008.

  1. szimek

    szimek Guest

    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!
     
    szimek, Feb 14, 2008
    #1
    1. Advertising

  2. 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.
     
    Jeremy J Starcher, Feb 14, 2008
    #2
    1. Advertising

  3. szimek

    szimek Guest

    On 14 Lut, 19:33, Jeremy J Starcher <> wrote:
    > 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.
     
    szimek, Feb 15, 2008
    #3
  4. szimek

    szimek Guest

    On 15 Lut, 15:22, szimek <> wrote:
    > On 14 Lut, 19:33, Jeremy J Starcher <> wrote:
    >
    >
    >
    > > 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.
     
    szimek, Feb 15, 2008
    #4
  5. 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
     
    Thomas 'PointedEars' Lahn, Feb 17, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yvad

    Stack overflow and memory problem?

    Yvad, Nov 4, 2005, in forum: C Programming
    Replies:
    11
    Views:
    843
    ishekara
    Nov 9, 2005
  2. Yvad
    Replies:
    11
    Views:
    570
    ishekara
    Nov 9, 2005
  3. Travis Pupkin

    Request.Form stack overflow

    Travis Pupkin, Nov 21, 2003, in forum: ASP General
    Replies:
    0
    Views:
    118
    Travis Pupkin
    Nov 21, 2003
  4. Kenneth McDonald

    Why stack overflow with such a small stack?

    Kenneth McDonald, Aug 30, 2007, in forum: Ruby
    Replies:
    7
    Views:
    263
    Kenneth McDonald
    Sep 1, 2007
  5. Replies:
    3
    Views:
    707
Loading...

Share This Page