$.ajax({
url: 'https://offcloud.com/api/cloud/status',
data: {'requestId' : 'theid'},
type: 'POST',
crossDomain: true, // enable this
xhrFields: {
withCredentials: true
},
success: function(data) {
var stringData =JSON.stringify(data);
el.innerHTML = "<pre lang='xml'>" + stringData + "</pre>";
console.log(data);
},
error: function() { console.log('Failed!'); }
});
Dies ist, was angezeigt wird:Wie man richtig AJAX angezeigten Post-Daten zurückgeben
{"data":[{"accountId":"5xxx","remoteOptionId":"yyyyyy","type":"gdrive","username":"[email protected]"}]}
Allerdings mag ich es richtig im XML-Format angezeigt. Oder irgendein tatsächlich lesbares Format, eine Tabelle (vorzugsweise eine Tabelle). Gibt es einen einfachen Weg, dies zu tun?
Verwenden Sie jQuery-Databases. – saurav