title: How can I convert following code to a vue js code?
body: <pre><code>     &lt;script type="text/javascript"&gt;
      navigator.geolocation.getCurrentPosition(success, error);
  
      function success(position) {
  
          var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + position.coords.latitude + '%2C' + position.coords.longitude + '&amp;language=en';
  
          $.getJSON(GEOCODING).done(function(location) {
              $('#country').html(location.results[0].address_components[5].long_name);
              $('#state').html(location.results[0].address_components[4].long_name);
              $('#city').html(location.results[0].address_components[2].long_name);
              $('#address').html(location.results[0].formatted_address);
              $('#latitude').html(position.coords.latitude);
              $('#longitude').html(position.coords.longitude);
          })
           $.ajax({
            url: 'post/filter/',
            data: {
              lat: position.coords.latitude,
              lon: position.coords.longitude,
            },
            type: "POST",
            dataType: 'json',
  
          });
      }
  
      function error(err) {
          console.log(err)
      }
  </code></pre>
  
  <p></p>
  
  <p>This is my code. I need to pass latitude and longitude as an ajax request to the server side to get values.. By using this code I am able to do so. </p>
  
  <p>My vue js code is</p>
  
  <pre><code>&lt;div id="categorie"&gt;
    &lt;div&gt;{{vector.name}}&lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
  categorie = new Vue({
      el: '#categorie',
      data: {
          vector: {},
      },
   methods: { 
  
              search_category: function success(position) {
                navigator.geolocation.getCurrentPosition(success, error);
              var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + position.coords.latitude + '%2C' + position.coords.longitude + '&amp;language=en';
  
              $.getJSON(GEOCODING).done(function(location) {
                  $('#country').html(location.results[0].address_components[5].long_name);
                  $('#state').html(location.results[0].address_components[4].long_name);
                  $('#city').html(location.results[0].address_components[2].long_name);
                  $('#address').html(location.results[0].formatted_address);
                  $('#latitude').html(position.coords.latitude);
                  $('#longitude').html(position.coords.longitude);
              })
               var filter = {};
               var self=this;
               filter['category'] = position.coords.latitude;
              filter['subcategory'] = position.coords.longitude;
              $.ajax({
                "url": "post/filter",
                 data: filter,
                dataType: "JSON",
                type: "POST",
                success: function(e) {
                    self.vector = e.data;
                  console.log(e);
                },
  
              });
            }
          }
  
  })
  &lt;/script&gt;
  </code></pre>
  
  <p>But when I use vue js code I am not able to send ajax request? Can any body please solve my issue Can someone please help me to solve this issue?</p>