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

help needed for yui connection manager-see my code

Expand Messages
  • gayu357
    var request; var object={ var handleSuccess=function(request){ var response = request.responseText;
    Message 1 of 4 , Apr 29, 2007
    • 0 Attachment
      <html>
      <head>
      <script type="text/javascript">>
      var request;

      var object={
      var handleSuccess=function(request){
      var response = request.responseText;
      document.getElementById("Layer1").innerHTML = response;
      }

      var handleFailure=function(request){
      alert("status is " + request.status);
      };

      var callback{
      success:object.handleSuccess,
      failure:object.handleFailure
      };


      function getdata()
      {
      request=YAHOO.util.Connect.asyncRequest('GET',"yui.php", callback,null);
      }
      </script>
      <body>
      <a href="javascript:getdata();">click here</a>
      <div id="Layer1"></div>
      </body>
      </html>
      Im new to yui connection manager.
      this is my code.i hav a php file yui.php which retrives data frm
      database.I tried the above code but its not working.can u suggest the
      rite way.plz help.
    • Jon Herron
      Gayu357 - Is that the actual code that you are trying to run? If so it appears that you have a copy things wrong, not including the needed YUI libraries for
      Message 2 of 4 , Apr 29, 2007
      • 0 Attachment
        Gayu357 -

          Is that the actual code that you are trying to run?  If so it appears that you have a copy things wrong, not including the needed YUI libraries for connections manager, and extra > after the script tag, you appear to be missing a } for your failure case (im assuming the }; is supposed to be for the object?  Looks like there is no need for request to be a global variable, but odds are that is not the major issue right now.

          To see the required libraries and some examples:

          http://developer.yahoo.com/yui/connection/
         
        Thanks,

        Jon Herron

        Left Turn Solutions - Home of the Eddy Framework
        http://www.leftturnsolutions.com

        Offical Left Turn Solutions Development Blog
        http://360.yahoo.com/leftturnsolutions


        ----- Original Message ----
        From: gayu357 <gayu357@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Sunday, April 29, 2007 4:09:26 AM
        Subject: [ydn-javascript] help needed for yui connection manager-see my code

        <html>
        <head>
        <script type="text/javascri pt">>
        var request;

        var object={
        var handleSuccess= function( request){
        var response = request.responseTex t;
        document.getElement ById("Layer1" ).innerHTML = response;
        }

        var handleFailure= function( request){
        alert("status is " + request.status) ;
        };

        var callback{
        success:object. handleSuccess,
        failure:object. handleFailure
        };

        function getdata()
        {
        request=YAHOO. util.Connect. asyncRequest( 'GET',"yui. php", callback,null) ;
        }
        </script>
        <body>
        <a href="javascript: getdata() ;">click here</a>
        <div id="Layer1"> </div>
        </body>
        </html>
        Im new to yui connection manager.
        this is my code.i hav a php file yui.php which retrives data frm
        database.I tried the above code but its not working.can u suggest the
        rite way.plz help.




        Ahhh...imagining that irresistible "new car" smell?
        Check out new cars at Yahoo! Autos.
      • gayu357
        ill send u the code again.actully those all things u mentioned r their in my code,but still its not working.
        Message 3 of 4 , Apr 29, 2007
        • 0 Attachment
          ill send u the code again.actully those all things u mentioned r their
          in my code,but still its not working.
          <html>
          <head>

          <script
          src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script>
          <script
          src="http://yui.yahooapis.com/2.2.2/build/connection/connection-min.js"></script>
          <script type="text/javascript">

          var object={

          var handleSuccess=function(request){
          var response = request.responseText;
          document.getElementById("Layer1").innerHTML = response;
          }

          var handleFailure=function(request){
          alert("status is " + request.status);
          };

          var callback{
          document.write("in callback");
          success:object.handleSuccess,
          failure:object.handleFailure
          };
          function getdata()
          {
          request=YAHOO.util.Connect.asyncRequest('GET',"yuiconn.php",
          callback,null);
          }
          </script>
          </head>
          <body>
          <a href="javascript:getdata();">click here</a>
          <div id="Layer1"></div>
          </body></html>

          layer1 id is present.yuiconn.php is php file tat retrives data frm
          database.one more thing,im using yui css grids.
          now tell me where am i wrong? thanks
        • tssha
          ... src= http://yui.yahooapis.com/2.2.2/build/connection/connection-min.js ... 1) Remove the document.write() in the callback; that alone should
          Message 4 of 4 , Apr 30, 2007
          • 0 Attachment
            --- In ydn-javascript@yahoogroups.com, "gayu357" <gayu357@...> wrote:
            >
            > ill send u the code again.actully those all things u mentioned r their
            > in my code,but still its not working.
            > <html>
            > <head>
            >
            > <script
            > src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script>
            > <script
            >
            src="http://yui.yahooapis.com/2.2.2/build/connection/connection-min.js"></script>
            > <script type="text/javascript">
            >
            > var object={
            >
            > var handleSuccess=function(request){
            > var response = request.responseText;
            > document.getElementById("Layer1").innerHTML = response;
            > }
            >
            > var handleFailure=function(request){
            > alert("status is " + request.status);
            > };
            >
            > var callback{
            > document.write("in callback");
            > success:object.handleSuccess,
            > failure:object.handleFailure
            > };
            > function getdata()
            > {
            > request=YAHOO.util.Connect.asyncRequest('GET',"yuiconn.php",
            > callback,null);
            > }
            > </script>
            > </head>
            > <body>
            > <a href="javascript:getdata();">click here</a>
            > <div id="Layer1"></div>
            > </body></html>
            >
            > layer1 id is present.yuiconn.php is php file tat retrives data frm
            > database.one more thing,im using yui css grids.
            > now tell me where am i wrong? thanks

            1) Remove the document.write() in the callback; that alone should
            throw a syntax error.
            2) You create your callback handlers as as object members, but you do
            not define the scope property in your callback.

            Regards,
            Thomas
          Your message has been successfully submitted and would be delivered to recipients shortly.