SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict hiddenpearls's Avatar
    Join Date
    Dec 2007
    Location
    Pakistan
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow $.ajax error callback

    code below doesn't run the error function. it runs success function when there is response.
    what callback should be used when the requested URL exists or not ? or not found ?
    Code:
    $.ajax({
                                         type: "GET",
                                         url: appServer,
                                         data: "action=config",
                                         success: function(response){
                                                     alert('Success');
                                            },
                                          error: function(){
                      
    alert('Error');
    }
    )};

  2. #2
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $.ajax({
    type: "GET",
    url: appServer,
    data: "action=config",
    success: function(response){
    alert('Success');
    },
    error: function(){
    alert('Error');
    }
    });

    In the end you mixed up )} instead of })




Tags for this Thread

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
  •