Strange FireFox problem - too much recursion

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

    #1

    Strange FireFox problem - too much recursion

    Hi!

    I've implemented some DropDown list in ASP.NET that use Ajax to fetch
    the data from the server. The javascript is written to call cascading to
    the bottom most dropdown in order to update them all if a top one changed.
    The strange thing is that the script runs without problems on IE but in
    FireFox i get a "too much recursion" error and nothing happens.

    Here is the javascript code generated:

    <script language="JavaS cript">
    <!--
    function _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang() {
    var value = document.getEle mentById( "_ctl12_cob_cli ent" ).value;
    var para_0=2;

    AjaxMethods.Get ChannelsByClien tByLang( value, para_0,
    _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack );
    }

    function
    _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack(
    response ) {
    var ds = response.value;
    if(ds != null && typeof(ds) == "object" && ds.Tables != null){
    var reciever = document.getEle mentById("_ctl1 2_acob_channel" );
    var viewStateElem =
    document.getEle mentsByName("_c tl12_acob_chann el_VIEWSTATE")[0];
    Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
    _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g()
    } else {
    alert("DataSet corrupted or no data");
    }
    }


    function _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g() {
    var value = document.getEle mentById( "_ctl12_acob_ch annel" ).value;
    var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
    var para_1=2;

    AjaxMethods.Get CategoryByChann elClientLang( value, para_0, para_1,
    _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback );
    }

    function
    _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback(
    response ) {
    var ds = response.value;
    if(ds != null && typeof(ds) == "object" && ds.Tables != null){
    var reciever = document.getEle mentById("_ctl1 2_acob_category ");
    var viewStateElem =
    document.getEle mentsByName("_c tl12_acob_categ ory_VIEWSTATE")[0];
    Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )

    _ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
    } else {
    alert("DataSet corrupted or no data");
    }
    }


    function
    _ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
    {
    var value = document.getEle mentById( "_ctl12_acob_ca tegory" ).value;
    var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
    var para_1=2;

    AjaxMethods.Get SubCategoriesBy MainCat_Client_ Language( value, para_0,
    para_1,
    _ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback
    );
    }

    function
    _ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback(
    response ) {
    var ds = response.value;
    if(ds != null && typeof(ds) == "object" && ds.Tables != null){
    var reciever = document.getEle mentById("_ctl1 2_acob_subcateg ory");
    var viewStateElem =
    document.getEle mentsByName("_c tl12_acob_subca tegory_VIEWSTAT E")[0];
    Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )

    } else {
    alert("DataSet corrupted or no data");
    }
    }



    function Fill_ListContro lFromDataBase( ds, reciever, viewStateElem,
    textFieldName, valueFieldName ) {
    if(ds != null && typeof(ds) == "object" && ds.Tables != null){
    var html = [];
    var i=0;
    while( reciever.childN odes.length > 0 ) {
    var node = reciever.childN odes[0];
    reciever.remove Child( node );
    }
    var vs = [];
    for(i=0; i<ds.Tables[0].Rows.length; i++) {
    var txt = ds.Tables[0].Rows[i][textFieldName];
    var id = ds.Tables[0].Rows[i][valueFieldName]
    vs[vs.length] = id + ":" + txt + "|";
    var opt = document.create Element("option ");
    var txt = document.create TextNode( txt );
    var atr = document.create Attribute( "value" );
    atr.nodeValue = id;
    opt.setAttribut eNode( atr );
    opt.appendChild ( txt );
    reciever.append Child( opt );
    }

    if ( viewStateElem != null ) {
    viewStateElem.v alue = vs.join("");
    } else {
    alert("No ViewStateFound" );
    }
    }
    }

    // -->
    </script>

    Each function on it's own works if i remove the calls for the child
    value method.

    Has anyone an idea how this can happen as there is no recursion in this
    functions.

    thanks in advance and greetings,
    chris


  • kaeli

    #2
    Re: Strange FireFox problem - too much recursion

    In article <newscache$28w2 gi$pac1$1@news. sil.at>, e9806056
    @student.tuwien .ac.at enlightened us with...[color=blue][color=green]
    >>[/color]
    > Has anyone an idea how this can happen as there is no recursion in this
    > functions.[/color]

    There is, but you'd have to understand a stack (and realize that a stack is
    what is being used) to realize it.
    It's a stack overflow error.

    As to why it happens and how to fix it, I'd need a full test example (URL?).
    I hate reading through generated code and it's worse when I don't have a DOM
    to look at to trace it.

    You may want to grab the web developer firefox extension.
    --
    --
    ~kaeli~
    Is it possible to be totally partial?



    Comment

    • Christian Hubinger

      #3
      Re: Strange FireFox problem - too much recursion

      kaeli wrote:[color=blue]
      > In article <newscache$28w2 gi$pac1$1@news. sil.at>, e9806056
      > @student.tuwien .ac.at enlightened us with...
      >[color=green]
      >>Has anyone an idea how this can happen as there is no recursion in this
      >>functions.[/color]
      >
      >
      > There is, but you'd have to understand a stack (and realize that a stack is
      > what is being used) to realize it.[/color]

      Well i know this. The thing is that i can'tz find any parts in the
      methods that may cause trouble with the stack. There are max. 8 method
      calls before the script terminates and in IE it runns without any
      warnings or problems.
      [color=blue]
      > It's a stack overflow error.
      >
      > As to why it happens and how to fix it, I'd need a full test example (URL?).
      > I hate reading through generated code and it's worse when I don't have a DOM
      > to look at to trace it.[/color]

      I'll setup a page for you and send you the URL when it' available.
      [color=blue]
      >
      > You may want to grab the web developer firefox extension.[/color]

      I'll try that

      thanks & greetings,
      chris

      Comment

      • kaeli

        #4
        Re: Strange FireFox problem - too much recursion

        In article <newscache$yq86 gi$ao7$1@news.s il.at>, e9806056
        @student.tuwien .ac.at enlightened us with...[color=blue]
        >
        > Well i know this. The thing is that i can'tz find any parts in the
        > methods that may cause trouble with the stack.[/color]

        Okay, I looked at this more thoroughly, and what I don't see is the initial
        call to this function (this function seems to set all the rest in motion):

        function _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang() {
        var value = document.getEle mentById( "_ctl12_cob_cli ent" ).value;
        var para_0=2;

        AjaxMethods.Get ChannelsByClien tByLang( value, para_0,
        _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack );
        }

        What calls this?
        And since the function it calls takes a parameter called 'response', where is
        that coming from?
        function
        _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack(
        response ) {
        var ds = response.value;
        [color=blue]
        >
        > I'll setup a page for you and send you the URL when it' available.
        >[/color]

        Let me know if you get one set up.
        I'm curious now. :)

        --
        --
        ~kaeli~
        A boiled egg in the morning is hard to beat.



        Comment

        • Christian Hubinger

          #5
          Re: Strange FireFox problem - too much recursion

          kaeli wrote:[color=blue]
          > In article <newscache$yq86 gi$ao7$1@news.s il.at>, e9806056
          > @student.tuwien .ac.at enlightened us with...
          >[color=green]
          >>Well i know this. The thing is that i can'tz find any parts in the
          >>methods that may cause trouble with the stack.[/color]
          >
          >
          > Okay, I looked at this more thoroughly, and what I don't see is the initial
          > call to this function (this function seems to set all the rest in motion):[/color]

          right this one calls the next hierachical level and so on. no recusion
          in this
          [color=blue]
          > function _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang() {
          > var value = document.getEle mentById( "_ctl12_cob_cli ent" ).value;
          > var para_0=2;
          >
          > AjaxMethods.Get ChannelsByClien tByLang( value, para_0,
          > _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack );
          > }
          >
          > What calls this?[/color]

          It is called by the OnChange Event handler in an DropDownList
          [color=blue]
          > And since the function it calls takes a parameter called 'response', where is
          > that coming from?[/color]

          This is the result DataSet that get initialised and transfered to the
          client by the Ajax.NET wrapper library.
          [color=blue]
          > function
          > _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack(
          > response ) {
          > var ds = response.value;
          >
          >[color=green]
          >>I'll setup a page for you and send you the URL when it' available.
          >>[/color]
          >
          > Let me know if you get one set up.
          > I'm curious now. :)
          >[/color]

          Will let you know - maybe i'll manage it to bring it online tonight.

          thanks and greetings,
          chris

          Comment

          • Christian Hubinger

            #6
            Re: Strange FireFox problem - too much recursion

            Christian Hubinger wrote:[color=blue]
            > kaeli wrote:
            >
            >[snip][color=green]
            >>
            >> Let me know if you get one set up.
            >> I'm curious now. :)
            >>[/color]
            >
            > Will let you know - maybe i'll manage it to bring it online tonight.[/color]

            Well i've put it online today.

            Register yourself at http://www.jobline.cc/jobline.cc
            And after logging in insert the URL:


            Theere you should see 4 drop down lists updating each other without
            doing postbacks - works perfectely in IE but FireFox throws the
            described errors.


            thanks in advance for your help and greetings,
            chris

            Comment

            • kaeli

              #7
              Re: Strange FireFox problem - too much recursion

              In article <newscache$w0p8 gi$nah$1@news.s il.at>, e9806056
              @student.tuwien .ac.at enlightened us with...[color=blue]
              >
              > Register yourself at http://www.jobline.cc/jobline.cc[/color]

              I don't speak German. I don't what to put where in that form.
              Register a test account and mail me the username/pass at
              tiny_one (at) comcast (dot) net
              and I'll check it out when I get home tonight.
              Or you can post it here (x-no-archive) and delete the account later.
              Whichever floats your boat. :)

              You should have a test account set up anyway, even on the production machine,
              for things just like this.

              For best error tracing, though, you need to pull out as much code as possible
              while still recreating the error conditions. Put that in a test page that
              doesn't need registering or logging in. It's a LOT easier to trace things
              when you pull out all the stuff that does work. Many times I've found my
              error just putting together the test case.

              --
              --
              ~kaeli~
              Condoms should be used on every conceivable occasion.



              Comment

              • Christian Hubinger

                #8
                Re: Strange FireFox problem - too much recursion

                kaeli wrote:[color=blue]
                > In article <newscache$w0p8 gi$nah$1@news.s il.at>, e9806056
                > @student.tuwien .ac.at enlightened us with...
                >[color=green]
                >>Register yourself at http://www.jobline.cc/jobline.cc[/color]
                >
                > I don't speak German.[/color]

                Well i understand we need to add a flag to our language change menu ;)
                [color=blue]
                > I don't what to put where in that form.
                > Register a test account and mail me the username/pass at
                > tiny_one (at) comcast (dot) net
                > and I'll check it out when I get home tonight.
                > Or you can post it here (x-no-archive) and delete the account later.
                > Whichever floats your boat. :)[/color]

                Well thanks a lot for you help offer but i've just updated the Ajax.NET
                dll we are using to handle XmlHttpRequests and the problem disappeared.
                So it was actually a problem with one of the client script this library
                thrown on the client.
                [color=blue]
                > You should have a test account set up anyway, even on the production machine,
                > for things just like this.[/color]

                We are planning to have such a test platform online as soon as we do the
                official launch of the plattform. So everything now online is a test
                plattform.
                [color=blue]
                > For best error tracing, though, you need to pull out as much code as possible
                > while still recreating the error conditions. Put that in a test page that
                > doesn't need registering or logging in. It's a LOT easier to trace things
                > when you pull out all the stuff that does work. Many times I've found my
                > error just putting together the test case.[/color]


                Shurely that is what i did on the page i use for testing. The problem is
                that we are using our own home brewn portal software and therefore i
                neet to test if things work inside that environment. Thats the reason
                why i didn't put a simple blank page online.
                But you are accutally right i'll setup such a simple playground in the
                near future to track down such problems.

                So again thanks a lot for your offer.

                greetings from vienna,
                chris


                Comment

                • kaeli

                  #9
                  Re: Strange FireFox problem - too much recursion

                  In article <newscache$5iyb gi$uiu$1@news.s il.at>, e9806056
                  @student.tuwien .ac.at enlightened us with...[color=blue]
                  >
                  > Well thanks a lot for you help offer but i've just updated the Ajax.NET
                  > dll we are using to handle XmlHttpRequests and the problem disappeared.
                  > So it was actually a problem with one of the client script this library
                  > thrown on the client.[/color]

                  I had a feeling it was.
                  Glad you solved the problem.

                  --
                  --
                  ~kaeli~
                  Murphy's Law #2000: If enough data is collected, anything
                  may be proven by statistical methods.



                  Comment

                  • Thomas 'PointedEars' Lahn

                    #10
                    Re: Strange FireFox problem - too much recursion

                    Christian Hubinger wrote:
                    [color=blue]
                    > kaeli wrote:[color=green]
                    >> @student.tuwien .ac.at enlightened us with...[color=darkred]
                    >>> Register yourself at http://www.jobline.cc/jobline.cc[/color]
                    >> I don't speak German.[/color]
                    >
                    > Well i understand we need to add a flag to our language change menu ;)[/color]

                    No, you don't :) <http://www.cs.tut.fi/~jkorpela/flags.html>


                    PointedEars
                    --
                    Messen, was messbar ist, und messbar machen, was noch nicht messbar ist.
                    -- Galileo Galilei

                    Comment

                    Working...