title: Check if AJAX response data if is empty or null than don't show in output
body: <p>This is ajax function, I want when data is <code>null</code> or <code>undefined</code> than output (<code>#access element</code>) show me empty "" ( or don't save any data in output when is null or not found )</p>
  
  <pre><code>  $(function(){
  
      $('#userId').on('keyup', function () {
        var value=$(this).val();
        $.ajax('/projectname/admin/getUserAccess/' + value,
          {
            dataType: 'JSON',
            success: function(data){
  
                var str = data.access.replaceAll(/\|/g, ',');
                var result = str.substring(1, str.length - 1);
  
                $("#access").val(result);
  
            }
          });
      });
    });
  </code></pre>