title: How to hide a button based on a returning value in success handler?
body: <p>I'm new to Jquery. I have a code like this : </p>
  
  <pre><code>$.ajax({
      url: "${createLink(controller :"
      tasks ", action :"
      holidayStatus ")}",
  
      data: "userName=" + $("#user").find('option:selected').text() + "&amp;date1=" + $("#datePicker").val() + "&amp;date2=" + $("#datePicker2").val(),
      cache: false,
      success: function(html) {
          $(".errors").append(html);
          $(".errors").delay(1000).fadeIn('slow');
          $("#createButton").delay(1000).fadeOut('slow');
      })​
  </code></pre>
  
  <p>This works as expected. In my <code>success</code> handler, I'm appending the <code>html</code> (which I got from server-side) to the <code>.errors</code> class. At the same time I'm hiding the button with id <code>createButton</code>. </p>
  
  <p>But what I want is a way to find whether <code>html</code> in <code>success</code> handler contains any data (there are chances that <code>html</code> doesn't have any <em>content</em> in it). If so I need to disable the <code>createButton</code> id if not I shouldn't do anything. </p>
  
  <p>How to proceed with it? </p>