Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Ajax request in YUI

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 534
    Comment on it

    Here is the simple example of YUI ajax with Post and Get method:

    POST request:

          var callback = {
                       success: function(o){
                            alert(o.responseText);
                        },
                        failure: function(o){
                            alert('Unable to connect to server.');
                        },
                        cache: false
                    }
            var url = 'my_url?id=1';
            YAHOO.util.Connect.asyncRequest('POST', url, callback);
    

    GET request

    var callback = {
                       success: function(o){
                            alert(o.responseText);
                        },
                        failure: function(o){
                            alert('Unable to connect to server.');
                        },
                        cache: false
                    }
            var url = 'my_url?id=1';
            YAHOO.util.Connect.asyncRequest('GET', url, callback);
    

    Please include YUI library also.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: