title: REST AJAX request to mongoDB
body: <p>I am trying to fire a <code>XMLHttpRequest</code> to mongoDB to retrieve a document via AJAX.</p>
  
  <p>This is my code:</p>
  
  <pre><code>function getJsonDocumentByModeldid(model_id) {
      var valoreInput = document.getElementById('inputModelId').value;
      alert(valoreInput);
  
      $.ajax({
        url: "http://localhost:28017/test/",
        type: "get",
        //data: "filter_a=" + valoreInput,
        dataType: 'jsonp',
        crossDomain: true,
  
        success: function (data) {
          alert("success");
          //var json2javascript = $.parseJSON(data);
          manageLayout();
        },
  
        error: function (XMLHttpRequest, textStatus, errorThrown) {
         alert("Status: " + textStatus + "    Error:" + errorThrown);
        }
    });
  }
  </code></pre>
  
  <p>My function always returns an error. So what is the problem?</p>