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

Calling connection object from child window problem

Expand Messages
  • Troy Wolf
    I have a javascript object with a function (method) that uses the connection object. The app opens a child window that uses the TinyMCE rich-text editor. When
    Message 1 of 5 , Jun 1, 2006
    • 0 Attachment
      I have a javascript object with a function (method) that uses the
      connection object. The app opens a child window that uses the TinyMCE
      rich-text editor. When the user saves the content they were editing,
      the child window returns with just enough code to fire the parent
      window's LoadPhotoDetails function and close itself using
      self.close(); The line I use to fire the parent's function is this:

      window.opener.SiteAlbum.LoadPhotoDetails();

      "SiteAlbum" being the name of the existing javascript object created
      in the parent.

      The child window is successfully firing the parent's function. I can
      insert debugging alert() statements to see the values of variables and
      such---everything looks good to me. However, when the connection
      object is fired, it returns immediately with a failure status of 0.
      Using an alert() statement, I have tested the URL value I'm sending
      the connection object--it is good and does return promptly and
      successfully. Of course calling this same function within the parent
      itself works fine as expected. Ideas?

      Here is the parent's LoadPhotoDetails() function:

      ...
      LoadPhotoDetails : function() {
      // Clean out current values to load new data.
      this.adata[this.aimgs[this.curID]] = new Array();
      this.adata[this.aimgs[this.curID]]['caption'] = "";
      this.adata[this.aimgs[this.curID]]['filesize'] = "";
      this.adata[this.aimgs[this.curID]]['dimensions'] = "";
      this.adata[this.aimgs[this.curID]]['timestamp'] = "";

      var url =
      "/SiteAlbum/index.php?a="+this.path+"&m=details&i="+this.curID;
      var callback =
      {
      success: this.AJAXsuccess,
      failure: this.AJAXfailure,
      argument: new Array("LoadPhotoDetails"),
      scope: this
      }
      var cObj = YAHOO.util.Connect.asyncRequest('GET',url,callback,null);
      }, ...
    • Troy Wolf
      Here is some additional information that I m sure helps point to the root issue. HOWEVER, I don t know what that is still. I fixed my problem by placing a
      Message 2 of 5 , Jun 1, 2006
      • 0 Attachment
        Here is some additional information that I'm sure helps point to the
        root issue. HOWEVER, I don't know what that is still.

        I "fixed" my problem by placing a hidden button on the parent window.
        I have the child window use
        document.getElementById('hiddenbutton').click() to click the button
        which has an onclick event of "SiteAlbum.LoadPhotoDetails()".

        Now why this works but directly calling the function does not....I
        don't know. Like I said, though, I'm sure it's a glaring clue.
      • Philip Tellis
        ... What s the value of this in each case? -- If a 6600 used paper tape instead of core memory, it would use up tape at about 30 miles/second. -- Grishman,
        Message 3 of 5 , Jun 1, 2006
        • 0 Attachment
          Sometime on Jun 1, TW cobbled together some glyphs to say:

          > I "fixed" my problem by placing a hidden button on the parent window.
          > I have the child window use
          > document.getElementById('hiddenbutton').click() to click the button
          > which has an onclick event of "SiteAlbum.LoadPhotoDetails()".
          >
          > Now why this works but directly calling the function does not....I
          > don't know. Like I said, though, I'm sure it's a glaring clue.

          What's the value of "this" in each case?


          --
          If a 6600 used paper tape instead of core memory, it would use up tape
          at about 30 miles/second.
          -- Grishman, Assembly Language Programming
        • sebastianmarconi
          Hi, I have the same problem but only with firefox 1.5.0.1. It works with IE 6, Konqueror 3.5.2 and Opera 9. I think the bug is related with closing the child
          Message 4 of 5 , Jun 2, 2006
          • 0 Attachment
            Hi,
            I have the same problem but only with firefox 1.5.0.1. It works with
            IE 6, Konqueror 3.5.2 and Opera 9.
            I think the bug is related with closing the child window while the
            Async request is perfomed.

            --- In ydn-javascript@yahoogroups.com, Philip Tellis
            <philip.tellis@...> wrote:
            >
            > Sometime on Jun 1, TW cobbled together some glyphs to say:
            >
            > > I "fixed" my problem by placing a hidden button on the parent
            window.
            > > I have the child window use
            > > document.getElementById('hiddenbutton').click() to click the
            button
            > > which has an onclick event of "SiteAlbum.LoadPhotoDetails()".
            > >
            > > Now why this works but directly calling the function does
            not....I
            > > don't know. Like I said, though, I'm sure it's a glaring clue.
            >
            > What's the value of "this" in each case?
            >
            >
            > --
            > If a 6600 used paper tape instead of core memory, it would use up
            tape
            > at about 30 miles/second.
            > -- Grishman, Assembly Language Programming
            >
          • sebastianmarconi
            Definitively it s a firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=249843 Some workaround:
            Message 5 of 5 , Jun 5, 2006
            • 0 Attachment
              Definitively it's a firefox bug:
              https://bugzilla.mozilla.org/show_bug.cgi?id=249843

              Some workaround:
              http://the-stickman.com/web-development/javascript/iframes-xmlhttprequest-bug-in-firefox/

              --- In ydn-javascript@yahoogroups.com, "sebastianmarconi"
              <sebastianmarconi@...> wrote:
              >
              > Hi,
              > I have the same problem but only with firefox 1.5.0.1. It works
              with
              > IE 6, Konqueror 3.5.2 and Opera 9.
              > I think the bug is related with closing the child window while the
              > Async request is perfomed.
              >
              > --- In ydn-javascript@yahoogroups.com, Philip Tellis
              > <philip.tellis@> wrote:
              > >
              > > Sometime on Jun 1, TW cobbled together some glyphs to say:
              > >
              > > > I "fixed" my problem by placing a hidden button on the parent
              > window.
              > > > I have the child window use
              > > > document.getElementById('hiddenbutton').click() to click the
              > button
              > > > which has an onclick event of "SiteAlbum.LoadPhotoDetails()".
              > > >
              > > > Now why this works but directly calling the function does
              > not....I
              > > > don't know. Like I said, though, I'm sure it's a glaring clue.
              > >
              > > What's the value of "this" in each case?
              > >
              > >
              > > --
              > > If a 6600 used paper tape instead of core memory, it would use
              up
              > tape
              > > at about 30 miles/second.
              > > -- Grishman, Assembly Language Programming
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.