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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • szimek

    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.submi t()" (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!
  • Jeremy J Starcher

    #2
    Re: Strange problem with form.submit() on FF and stack overflow

    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.

    Comment

    • szimek

      #3
      Re: Strange problem with form.submit() on FF and stack overflow

      On 14 Lut, 19:33, Jeremy J Starcher <r3...@yahoo.co mwrote:
      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.

      Comment

      • szimek

        #4
        Re: Strange problem with form.submit() on FF and stack overflow

        On 15 Lut, 15:22, szimek <szi...@gmail.c omwrote:
        On 14 Lut, 19:33, Jeremy J Starcher <r3...@yahoo.co mwrote:
        >
        >
        >
        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.

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Strange problem with form.submit() on FF and stack overflow

          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

          Comment

          Working...