SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Location
    London, UK
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery - How do I execute function after ajax call

    This is what I cam currently doing
    Code:
           function getaccountcurncy2(){
                    var entity = $("#sourceacctno").val();
                    //alert(entity);
                    $.ajax({
                            type: "POST",
                            url: "getpartneraccountcurncy.php",
                            data: 	"param=" + entity,
                            success: function(html){
                                    $("#sourcactcurncy").val(html);
                            }
                    });
                    $().ajaxComplete(function() { getexchrate()})
                }
    Basically I want to execute getexchrate() after the ajax call is complete. etexchrate() is already defined.
    Prov. 13:20 - He that walketh with wise men shall be wise: but a
    companion of fools shall be destroyed

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Make that part of the "success" function a few lines up in the original AJAX request.

    Code:
                            success: function(html){
                                    $("#sourcactcurncy").val(html);
                                    getexchrate();
                            }

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Location
    London, UK
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Now why didn't i think of that?
    Prov. 13:20 - He that walketh with wise men shall be wise: but a
    companion of fools shall be destroyed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •