ho una chiamata molto semplice ajax per avvisare i dati che è stato segnalato dal serverspettacoli dati jquery ajax [object Object]
$.ajax({
type: "POST",
url: "/someform/act", //edit utl to url
data: { changed: JSON.stringify(plainData) }, //edit to include
success: function(data) {
alert(data); //data not $data
},
error: function() {
//error condition code
}
});
Secondo il docs sul sito di jQuery per quanto riguarda campo dati sul callback successo , dice che i dati restituiti sono i dati dal server. Tuttavia, per qualche strana ragione, quando ho a segnalare a $data
, ottengo [object Object]
mi aspettavo di vedere qualcosa di simile, dal momento che questo è ciò che il server potrebbe inviare indietro
<status>0</status>
EDIT:
dati sono anche passato come il POST
Cosa ottieni se usi 'alert (dati);'? –
Il server ha restituito XML, jQuery ha poi analizzato detto xml. Quello che hai è un documento xml. Prova 'console.log (dati)' –
Ottiene 'successo' quando allarme i dati – tawheed