jQuery ajax invocation

[javascript]
jQuery.ajax({
type: "GET", //GET or POST or PUT or DELETE verb
url: ‘index.php?’ , // Location of the service
data: param, //Data sent to server
contentType: "", // content type sent to server
dataType: "json", //Expected data format from server
processdata: true, //True or False
success: function (json) {//On Successful service call
var result = json.name;
jQuery("#dvAjax").html(result);
},
error: function(jqXHR, textStatus, errorThrown){

} // When Service call fails
});
[/javascript]
Snippet : Source

Leave a Reply