title: POST ajax request to API and display response with jQuery
body: <p>I'm trying to submit a form request to a RESTFUL API with ajax, and display the response in a div below the form. I have the following, but going blank on what I'm missing. The user should enter an integer value, and receive a JSON response similar to the following:</p>
  
  <pre><code>{
  "status": {
      "code": 200,
      "description": "OK"
  },
  "entity": "sN0u7"
  </code></pre>
  
  <p>}</p>
  
  <p>I need to display the <code>"entity"</code> value, along with a static URL prepended to the result. Example: <code>http://www.url.com/sN0u7</code></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-lg-6"&gt;
          &lt;div class="input-group"&gt; &lt;span class="input-group-btn"&gt;
          &lt;button class="btn btn-default" type="button"&gt;Go!&lt;/button&gt;
        &lt;/span&gt;
        &lt;input type="text" id="encodeID" class="form-control" placeholder="Search by ID"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="share-link well"&gt;&lt;/div&gt;`
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>var name = $("#encodeID").val();
  $.ajax({
      type: "POST",
      url: 'https://url.com/rest/v1/utils/guid/encode/' + 'encodeID',
      data: dataString,
      success: function (data) {
          $(".share-link").val(data);
      });
  }
  });
  return false;
  </code></pre>
  
  <p><strong>Current Fiddle: <a href="http://jsfiddle.net/mattography/6ywbtsys/" rel="nofollow">Link</a></strong></p>