Check value is null or empty or undefined
function isNullOrEmpty(value) {if (typeof value !== "undefined" && value != "null" && value != null && value.trim() != "") {return false;} else {return true;}}
ajax Call format
$.blockUI({css: {border: 'none', backgroundColor: 'transparent'}});
$.ajax({
url: "${createLink(controller: '', action: '')}",
data: {},
type: "POST",
dataType: "html",
success: function (data) {
$.unblockUI();
},
error: function (xhr, status) {
$.unblockUI();
},
complete: function (xhr, status) {
$.unblockUI();
}
});
ajax dataTypes
dataType: "html" dataType: "JSON"
Loader Type in jquery
$.blockUI({css: {border: 'none', backgroundColor: 'transparent'}}); $.unblockUI(); showLoader(); hideLoader();