title: How to make an Ajax request in Joomla Component
body: <p>This a screen shot of what I get when I call my ajax request:</p>
  
  <p><img src="https://i.stack.imgur.com/A0zAu.png" alt="enter image description here"></p>
  
  <p>How do I run only the task, without printing the whole page? This is my ajax call:</p>
  
  <pre><code>$.ajax
  ({
  type: "POST",
  url: "index.php?option=com_similar&amp;task=abc",
      data: {
          id: id,
          name: name,
          similar_id: similar_id,
      },
  cache: false,
  success: function(html)
  {
  $("#flash").fadeOut("slow");
  $("#content"+similar_id).html(html);
  } 
  });
  });
  
  $(".close").click(function()
  {
  $("#votebox").slideUp("slow");
  });
  
  });
  </code></pre>