function doAjaxCall(url, dataMap){
var jqxhr =$.ajax({ uri: uri,
type: "POST",
data: dataMap,
cache: false,
async: false
})
.success( function(){})
.error(function() {})
.complete(function() {});
return jqxhr;
}
var data={};
data.inputOne = 1;
data.inputTwo = "test";
url= "testUrl.do" ;
jqxhr = doAjaxCall(url, data);
jqxhr.success(function(html){
alert("return value is: " + html);
});
jqxhr.error(function(html){
alert("error occured: " + html);
});
No comments:
Post a Comment