Hi folks

Is it possible get the data from ajaxSuccess?

So I could validate data from any ajax request in serverside.

Example.

I am passing <div id="myid"  id2="myid2"  id3="myid3"  id4="myid4" ></div>


$().ajaxSuccess (function() {
    if ( $(data).attr("id") = 'myid') {
    // do stuff with data
    }
});

Look that this ajaxSuccess will test all ajax requests.

I know that I could do something like

   $.ajax({"type": "POST",
      "url": "foo.php ",
      "data": data,
      "dataType": "json",
      "success": on_success_one});

   $.ajax({"type": "POST",
      "url": " foo2.php",
      "data": data,
      "dataType": "json",
      "success": on_success_two});

So in this scenario I will test each AJAX request and One by one I could
create a sucess function.

But my question is different I want create a ajaxSuccess to test all data
from all AJAX request if someone fit my desire I run my function.

Regards

Mario Moura

Reply via email to