I wanted to create a little web page which ask this server (http://resumemanagerrestserver.juanwolf.cloudbees.net/) and use the XML received.
But the problem is when I do :
var resumes;
jQuery.ajax({
type: "GET",
url: "http://resumemanagerrestserver.juanwolf.cloudbees.net/?callback=?",
contentType: "text/plain; charset=utf-8 ",
dataType: "xml",
success: function (data, status, jqXHR) {
resumes = data;
},
error: function (jqXHR, status) {
// error handler
}
});
I have this response : ML Parsing Error: no element found Location: moz-nullprincipal:{2041758e-b063-4f84-898d-2ff62d487a5d} Line Number 1, Column 1:
I tried a GET request with Advanced REST client, it works.
If someone has a solution i will appreciate (and love him for the REST of my life)
Edit
I changed the old code by :
function getResumes() {
var resumes;
var url = 'http://resumemanagerrestserver.juanwolf.cloudbees.net/?callback=?';
var xhr = createCORSRequest('GET', url);
xhr.onreadystatechange = function() {if (xhr.readyState==4) alert("It worked!");};
xhr.setRequestHeader("Content-type", "application/xml");
xhr.setRequestHeader("Connection", "close");
if (!xhr) {
alert('CORS not supported');
return;
}
// Response handlers.
xhr.onload = function() {
resumes = xhr.responseText;
alert('Response from CORS request to ' + url + ': ' + resumes);
};
xhr.onerror = function() {
$('#errorPopupLink').get(0).click();
};
xhr.send();
return resumes;
}
Now, the request isn't red in Firebug, but I still have this
XML Parsing Error: no element found Location: moz-nullprincipal:{d9ee4013-542d-4f65-a310-e1719d99bcae} Line Number 1, Column 1
Someone has a solution ?