Giovanni Battista Lenoci wrote:
Hi, I'm looking on the doc, but I've a doubt about the ajaxSuccess
event.
In docs says:
The XMLHttpRequest and settings used for that request are passed as arguments
to the callback.
But in wich form?
I think is an object, but can you help me understand how is
structured?
In my particular case I made a request and I want to know which data
was send in the request to perform a particular action.in the ajax
success event.
Thank you
Give the success function the data returned by adding a parameter to the
function:
$.ajax({
success: function(*data*) {
// do stuff with data object
}
});
where data = whatever the url you made the request to returns. In your
case if it's xml the url might point to a file that produces the following:
<data-sent>
<key>old-value</key>
</data-sent>
<new-data>
<key>new-value</key>
</new-data>
Then your success function might look like this:
function(data) {
if ( $("data-sent",data) !== '' ) {
// do stuff
}
}
Sorry for the rough answer, might be able to help more if I know what
the server response looks like.
Rob