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

Simple Question about Connections

Expand Messages
  • David Baxter
    Alrighty...I am just starting with the YUI and I am having a tough time wrapping my head around the connection stuff. I followed all the examples and I can get
    Message 1 of 3 , Nov 30, 2006
      Alrighty...I am just starting with the YUI and I am having a tough
      time wrapping my head around the connection stuff.

      I followed all the examples and I can get my "successHandler" to fire.
      The problem is the server side. I can't find any documentation on how
      to load up the object that is given to my successHandler.

      All the examples use things like o.responseText and o.responseXML, but
      nowhere does it show how the properties are loaded on the server side.

      Also, is there a way to call a specific method on the server side, or
      do you basically have to do all the work on the page_load?

      This is pretty basic stuff so I am surprised I haven't been able to
      find any docs on this.

      Can anyone help?

      Thanks,
      David
    • Thomas S. Sha
      ... Property responseText will be populated with the server response when the response header Content-type is text/plain or text/html. Property responseXML
      Message 2 of 3 , Nov 30, 2006
        --- In ydn-javascript@yahoogroups.com, "David Baxter"
        <davidandjen@...> wrote:
        >
        > Alrighty...I am just starting with the YUI and I am having a tough
        > time wrapping my head around the connection stuff.
        >
        > I followed all the examples and I can get my "successHandler" to fire.
        > The problem is the server side. I can't find any documentation on how
        > to load up the object that is given to my successHandler.
        >
        > All the examples use things like o.responseText and o.responseXML, but
        > nowhere does it show how the properties are loaded on the server side.

        Property responseText will be populated with the server response when
        the response header Content-type is text/plain or text/html. Property
        responseXML will be populated when the response header Content-type is
        text/xml or application/xml, assuming the server returns a well-formed
        document.

        * The following example PHP response will populate responseText:
        <?
        header('content-type: text/html');
        $htmlData = "<div>Update Successful</div>";
        echo $htmlData;
        ?>

        Assuming the transaction was successfuly, the response object's
        responseText member would have a value of: "<div>Update Successful</div>".

        * The following example PHP response will populate responseXML:
        <?
        header('content-type: application/xml');
        $xmlData = "<?xml version='1.0' encoding='UTF-8'?>
        <result><status>Update Successful</status></result>";
        echo $xmlData;
        ?>

        Assuming the transaction was successfuly, the response object's
        responseXML member would have a value of: Object XMLDocument.

        > Also, is there a way to call a specific method on the server side, or
        > do you basically have to do all the work on the page_load?

        Connection Manager, and XMLHttpRequest, is ignorant of server objects
        and processes beyond the URI/L provided.

        Regards,
        Thomas
      • David Baxter
        Thank you so much Thomas! That was perfect and really gets me on the right track. It seems like this stuff should be documented, or at least a link to where it
        Message 3 of 3 , Nov 30, 2006
          Thank you so much Thomas! That was perfect and really gets me on the
          right track.

          It seems like this stuff should be documented, or at least a link to
          where it is documented. Oh well.

          Thanks again,
          David
        Your message has been successfully submitted and would be delivered to recipients shortly.