title: CakePHP Ajax Call to get a list for Dropdown
body: <p>I am trying to change a drop down based on a previously selected drop down. I am able to write the function in jQuery.</p>
  
  <p>Since i am not able to use the URL path across various installation based on the server as i have to hard core the URL into the script.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function getCategory(){
      var industryId = $("#CompanyCompanyIndustryId").val();
      $.getJSON('http://localhost/gitgrow/users/fetch/'+industryId, function(data) {
          var options = '';
          $.each(data, function(key, value) { 
            options += '&lt;option value="' + key + '"&gt;' + value + '&lt;/option&gt;';
          });
          $("#CompanyCompanyCategoryId").html(options);
      })
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>How to achieve the same using CakePHP and JS component ?</p>