Sto provando a sparare a XMLHttpRequest
su mongoDB per recuperare un documento tramite AJAX.REST Richiesta AJAX a mongoDB
Questo è il mio codice:
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);
}
});
}
mia funzione restituisce sempre un errore. Quindi qual'è il problema?
Qual è l'errore? – andyb
la richiesta ajax fallisce con lo script, invece se copio url nel browser, la risposta del server con successo. non so qual è il problema ... – ilamaiolo
L'errore di avviso è Jqueryxxxxxx non è stato chiamato! – ilamaiolo