Loading ...
Sorry, an error occurred while loading the content.
 

Connection Manager responseSuccess() Function called over and over!

Expand Messages
  • kansalneha28
    Hi I have a javascript function that looks something like the code I have pasted below. The problem is that when I call this function in an event, for eg:
    Message 1 of 8 , May 31, 2006
      Hi

      I have a javascript function that looks something like the code I have
      pasted below. The problem is that when I call this function in an
      event, for eg: "onClick", the responseSuccess() gets called over and
      over again in an infinite loop. I am not able to figure out why, in
      fact I am using similar code else where and it works perfectly. Do any
      of you know what could be happening???

      Is it something in the function that might be causing it? Or could it
      be the location in the Html DOM from where this function is called, as
      far as I can see, the location of the function call in the DOM is the
      only difference between the working and the non-working case.

      Any help would be appreciated. Thanks.

      ------------------------ Function below ------------------------
      function getTooltip(divId, sourceId, filterId)
      {
      blankOrNull = /^\s*$/;
      var div = document.getElementById(divId);
      if(blankOrNull.test(div.innerHTML)) {
      div.innerHTML = "Tooltip";
      var responseSuccess = function(res)
      {
      var rowNodes =
      res.responseXML.getElementsByTagName("Result")[0].childNodes;
      for(i = 0; i < rowNodes.length; i++) {
      var rowChildNodes = rowNodes[i].childNodes
      var itemId = rowChildNodes[0].firstChild.nodeValue;
      tooltipInParan = "";
      if(rowChildNodes[1].firstChild != null) {
      tooltipInParan = rowChildNodes[1].firstChild.nodeValue;
      }
      var tooltipMain = rowChildNodes[2].firstChild.nodeValue;
      var htmlStr = "";
      if(!(blankOrNull.test(tooltipInParan)) && tooltipInParan !=
      "IsNull") {
      htmlStr += "<i>(" + tooltipInParan + ")</i><br>";
      }
      htmlStr += tooltipMain;
      var span =
      document.getElementById('tooltip-'+sourceId+'-'+filterId+'-'+itemId);
      span.innerHTML = htmlStr;
      }
      }

      var responseFailure = function(res)
      {
      // do nothing
      }

      var callback =
      {
      success:this.responseSuccess,
      failure:this.responseFailure
      }

      YAHOO.util.Connect.asyncRequest('GET','tooltip-ajax.action?sourceId='+sourceId+'&filterId='+filterId+'&viewLimit=10',callback,null);
      }
      else {
      //else code here
      }
      }
      ----------------------------------------------------------------
    • Thomas S. Sha
      ... Can you confirm you re using version 0.10.0 of the library? If so, can you please post the XML document as well, and I ll test from here. Regards, Thomas
      Message 2 of 8 , May 31, 2006
        --- In ydn-javascript@yahoogroups.com, "kansalneha28"
        <kansalneha28@...> wrote:
        >
        > Hi
        >
        > I have a javascript function that looks something like the code I have
        > pasted below. The problem is that when I call this function in an
        > event, for eg: "onClick", the responseSuccess() gets called over and
        > over again in an infinite loop. I am not able to figure out why, in
        > fact I am using similar code else where and it works perfectly. Do any
        > of you know what could be happening???
        >
        > Is it something in the function that might be causing it? Or could it
        > be the location in the Html DOM from where this function is called, as
        > far as I can see, the location of the function call in the DOM is the
        > only difference between the working and the non-working case.
        >
        > Any help would be appreciated. Thanks.
        >
        Can you confirm you're using version 0.10.0 of the library? If so,
        can you please post the XML document as well, and I'll test from here.

        Regards,
        Thomas
      • kansalneha28
        Hi Thomas Where do I figure out the version number from? I dont see a file that gives the version no. Which xml document should I post, the ajax response xml
        Message 3 of 8 , Jun 1, 2006
          Hi Thomas

          Where do I figure out the version number from? I dont see a file that
          gives the version no.

          Which xml document should I post, the ajax response xml document?

          Please clarify, thanks for the help.

          Neha.

          --- In ydn-javascript@yahoogroups.com, "Thomas S. Sha" <tsha@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "kansalneha28"
          > <kansalneha28@> wrote:
          > >
          > > Hi
          > >
          > > I have a javascript function that looks something like the code I have
          > > pasted below. The problem is that when I call this function in an
          > > event, for eg: "onClick", the responseSuccess() gets called over and
          > > over again in an infinite loop. I am not able to figure out why, in
          > > fact I am using similar code else where and it works perfectly. Do any
          > > of you know what could be happening???
          > >
          > > Is it something in the function that might be causing it? Or could it
          > > be the location in the Html DOM from where this function is called, as
          > > far as I can see, the location of the function call in the DOM is the
          > > only difference between the working and the non-working case.
          > >
          > > Any help would be appreciated. Thanks.
          > >
          > Can you confirm you're using version 0.10.0 of the library? If so,
          > can you please post the XML document as well, and I'll test from here.
          >
          > Regards,
          > Thomas
          >
        • Thomas S. Sha
          ... If you downloaded YUI from SourceForge, that is version 0.10.0. The previous version(0.9.0) was available on our developer site: developer.yahoo.com/yui.
          Message 4 of 8 , Jun 1, 2006
            --- In ydn-javascript@yahoogroups.com, "kansalneha28"
            <kansalneha28@...> wrote:
            >
            > Hi Thomas
            >
            > Where do I figure out the version number from? I dont see a file that
            > gives the version no.
            >
            > Which xml document should I post, the ajax response xml document?
            >
            > Please clarify, thanks for the help.
            >
            > Neha.

            If you downloaded YUI from SourceForge, that is version 0.10.0. The
            previous version(0.9.0) was available on our developer site:
            developer.yahoo.com/yui. Version 0.9.0 had a bug that resulted in an
            infinite callback loop.

            Yes, please post the response XML, and I'll try to see if I can
            replicate the problem, if upgrading doesn't solve it.

            Regards,
            Thomas
          • kansalneha28
            Oh okay, I downloaded it from yahoo developer site, I will upgrade the version and see if that solves the issue. I will let you know, thanks. Neha.
            Message 5 of 8 , Jun 1, 2006
              Oh okay, I downloaded it from yahoo developer site, I will upgrade the
              version and see if that solves the issue. I will let you know, thanks.

              Neha.

              --- In ydn-javascript@yahoogroups.com, "Thomas S. Sha" <tsha@...> wrote:
              >
              > --- In ydn-javascript@yahoogroups.com, "kansalneha28"
              > <kansalneha28@> wrote:
              > >
              > > Hi Thomas
              > >
              > > Where do I figure out the version number from? I dont see a file that
              > > gives the version no.
              > >
              > > Which xml document should I post, the ajax response xml document?
              > >
              > > Please clarify, thanks for the help.
              > >
              > > Neha.
              >
              > If you downloaded YUI from SourceForge, that is version 0.10.0. The
              > previous version(0.9.0) was available on our developer site:
              > developer.yahoo.com/yui. Version 0.9.0 had a bug that resulted in an
              > infinite callback loop.
              >
              > Yes, please post the response XML, and I'll try to see if I can
              > replicate the problem, if upgrading doesn't solve it.
              >
              > Regards,
              > Thomas
              >
            • kansalneha28
              Hi Thomas Upgrading the yahoo library fixed the issue, thanks a lot. By the way, in the 0.10.0 version, each folder has a filname-min.js, just curious to know
              Message 6 of 8 , Jun 1, 2006
                Hi Thomas

                Upgrading the yahoo library fixed the issue, thanks a lot.

                By the way, in the 0.10.0 version, each folder has a filname-min.js,
                just curious to know what is that for? Also in this version, there is
                not license.txt file at all, so is it okay not to include the license
                file in my project? Thanks.

                Neha.

                --- In ydn-javascript@yahoogroups.com, "kansalneha28"
                <kansalneha28@...> wrote:
                >
                > Oh okay, I downloaded it from yahoo developer site, I will upgrade the
                > version and see if that solves the issue. I will let you know, thanks.
                >
                > Neha.
                >
                > --- In ydn-javascript@yahoogroups.com, "Thomas S. Sha" <tsha@> wrote:
                > >
                > > --- In ydn-javascript@yahoogroups.com, "kansalneha28"
                > > <kansalneha28@> wrote:
                > > >
                > > > Hi Thomas
                > > >
                > > > Where do I figure out the version number from? I dont see a file
                that
                > > > gives the version no.
                > > >
                > > > Which xml document should I post, the ajax response xml document?
                > > >
                > > > Please clarify, thanks for the help.
                > > >
                > > > Neha.
                > >
                > > If you downloaded YUI from SourceForge, that is version 0.10.0. The
                > > previous version(0.9.0) was available on our developer site:
                > > developer.yahoo.com/yui. Version 0.9.0 had a bug that resulted in an
                > > infinite callback loop.
                > >
                > > Yes, please post the response XML, and I'll try to see if I can
                > > replicate the problem, if upgrading doesn't solve it.
                > >
                > > Regards,
                > > Thomas
                > >
                >
              • johns@worldwinner.com
                hi ... look here in the unzipped file: yui/README [rtfm!!] -- js oblique strategy: do the words need changing?
                Message 7 of 8 , Jun 1, 2006
                  hi

                  ( 06.06.01 21:00 -0000 ) kansalneha28:
                  > By the way, in the 0.10.0 version, each folder has a filname-min.js,
                  > just curious to know what is that for?

                  look here in the unzipped file:
                  yui/README

                  [rtfm!!]

                  --
                  \js oblique strategy: do the words need changing?
                • kansalneha28
                  Oh Thanks, I was searching it in the README within each package. Neha.
                  Message 8 of 8 , Jun 1, 2006
                    Oh Thanks, I was searching it in the README within each package.

                    Neha.

                    --- In ydn-javascript@yahoogroups.com, johns@... wrote:
                    >
                    > hi
                    >
                    > ( 06.06.01 21:00 -0000 ) kansalneha28:
                    > > By the way, in the 0.10.0 version, each folder has a filname-min.js,
                    > > just curious to know what is that for?
                    >
                    > look here in the unzipped file:
                    > yui/README
                    >
                    > [rtfm!!]
                    >
                    > --
                    > \js oblique strategy: do the words need changing?
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.