title: How to use ajax with Wordpress plugin for filtering?
body: <p>I have drop-down element, and on selection of one item I need to query from database and to show me result in second drop-down.</p>
  
  <p>I have several drop-down, I need to narrow the filter.</p>
  
  <p>I have to do it with ajax, but I am new in this. Where should i write query statement and which path to put in URL</p>
  
  <p>because I am doing it in WP, do I always have to do use url: admin-ajax.php default in WP?</p>
  
  <pre><code>//dropDownKlix ajax call
      jQuery("#dropDownKlix").change(function(){
          jQuery.ajax({
              url: 'admin-ajax.php',
              data: {"name":"name","value":$("#dropDownKlix option:selected").val()},
              type: 'POST',
              dataType: "json",
              success: function(data) {
                  alert('Success!');
              }
          });
      });
  </code></pre>
  
  <p>this is my ajax request, but I dont know where to put sql statement to filter and retrive data to show in another drop-down.</p>
  
  <p>Should I put in callback query or ?</p>
  
  <p>If you need more information, please ask me.</p>