title: Fetch data with Vue from Web API
body: <p>I have a Web API and I'm trying to get JSON Data from it by using Vue, but I get neither data or errors, so I don't what is wrong. I want to load the data when the page is loaded.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>const v = new Vue({
      el: '#divContent',
      ready: function () {
          this.loadData();
      },
      data: {
          content: 'loading',
          serverData: null
      },
      methods: {
          loadData: function (viewerUserId, posterUserId) {
              const that = this;
              $.ajax({
                  contentType: "application/json",
                  dataType: "json",
                  url: "http://my-webapi/",
                  method: "Post",
                  success: function (response) {                        
                      that.$data.serverData = response;
  
                  },
                  error: function () {
                      alert('Error')
                  }
              });
          }
      }
  });
  </code></pre>
  
  <p>My HTML</p>
  
  <pre><code>&lt;div id="divContent" class="content"&gt;
   {{ content }}
  &lt;/div&gt;
  </code></pre>