function hideXYZSection(){ sendAjaxGetCall(“/resourceUrl?input=”+input) .done(function(data) { if(data == 'true'){ $("#sectionDivId").show(); // show or hide } }).fail(function(xhr, error) { console.log('error: ' + xhr.statusText); }); }