Loading...

jQuery (1)

Logo jQuery
jQuery AJAX Example Nicolò Sonzogni | March 11, 2024
Here is first a jQuery AJAX example showing how to make an AJAX call in jQuery:
var jqxhr = 
    $.ajax({
       type: "POST",
       url: "/theServiceToCall.html",
       data: {
           name : "The name",
           desc : "The description"
        }
    })
    .done  (function(response, textStatus, jqXHR)    { alert("Success: " + response); })
    .fail  (function(jqXHR, textStatus, errorThrown) { alert("Error"); })
    .always(function(jqXHROrData, textStatus, jqXHROrErrorThrown)     { alert("complete"); })
    ;