I use the loader of jquery mobile for all my ajax queries, but in only one case, i would like the loader to be hidden.
Is there a way to do it ?
I use the loader of jquery mobile for all my ajax queries, but in only one case, i would like the loader to be hidden.
Is there a way to do it ?
function getData (urlPath, showLoading) {
$.ajax({
url : urlPath,
dataType: 'script',
beforeSend : function(xhr, opts){
if(showLoading)
{
//call loading code
}
},
success: function(data) {
//success logic here
},
error: function(xhr, status) {
// error handling here
},
complete: function(){
console.log('DONE');
if (showLoading)
{
//stop the display of loading in complete method
}
}
});
}