initial commit
This commit is contained in:
39
public/js/Common/ajax-helper.js
vendored
Normal file
39
public/js/Common/ajax-helper.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var ajax_helper = {
|
||||
ajaxDataCallback: function (url,type, datatype, data, header) {
|
||||
var returnData;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: type,
|
||||
url: url,
|
||||
dataType: datatype,
|
||||
data: data,
|
||||
headers:header,
|
||||
error: function (jqXHR, textStatus, errorMessage) {
|
||||
console.log("Error: ", errorMessage);
|
||||
},
|
||||
success: function (result) {
|
||||
returnData= result;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
},
|
||||
ajaxAsyncDataCallback: function (url,type, datatype, data, header, callback) {
|
||||
$.ajax({
|
||||
async: true,
|
||||
type: type,
|
||||
url: url,
|
||||
dataType: datatype,
|
||||
data: data,
|
||||
headers:header,
|
||||
error: function (jqXhr, textStatus, errorMessage) {
|
||||
console.log("Error: ", errorMessage);
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
callback(data);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user