title: OctoberCms How to pass ajax response to javascript function
body: <p>I created a form in my component html file, When i submit a form an ajax call triggers to my action defined in component. So far my code is working fine i'm getting response. But now i want the response to be passed to the javscript function that i created inside component htm file.</p>
  
  <pre><code>function markAddresses(addresses) {
  geocoder = new google.maps.Geocoder();
  addresses.forEach(address =&gt; {
    geocoder.geocode({'address': address}, function(results, status) {
     if (status === 'OK') {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({map: map,position: results[0].geometry.location});
         } else {
        alert('Geocode was not successful for the following reason: ' + status);
     }
    });
    })
  </code></pre>
  
  <p>}</p>
  
  <p>I want to pass my response like markAddresses(response)</p>
  
  <pre><code>&lt;form method="post" data-request="onSend"&gt;
  &lt;div class="col-md-5"&gt;
      &lt;input type="text" name="location" class="form-control"&gt;
  &lt;/div&gt;
  &lt;div class="col-md-2"&gt;
  
      &lt;select name="service[]" id="services" class="form-control"&gt;&amp;nbsp;
          {% for client in records %}
              &lt;option value="{{ client.service }}"&gt;{{ client.service }}&lt;/option&gt;
          {% endfor %}
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="col-md-2"&gt;
      &lt;select name="area[]" id="search" class="form-control" &gt;&amp;nbsp;
          {% for client in records %}
              &lt;option value="{{ client.area }}"&gt;{{ client.area }} Miles&lt;/option&gt;
          {% endfor %}
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="col-md-3"&gt;
      &lt;input type="submit" value="Looks for Shops" class="red-btn btn btn-default"&gt;
      &lt;a class="location-view" href="#"&gt;View all Shops&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is how my Ajax is working. I think it is using octobercms Ajax framework</p>