Hello,
I'm currently looking for a way of "pre-processing" ajax results before they are returned to the actual caller of the ajax request. Allow me to clarify what we need.
We are confronted with legacy code, all of which is currently being converted to jQuery.
All AJAX is returned as a JSON object from the server, which is supposed to allow me to have the controller file to add generic return values to the object before it is sent to the client. Each JSON object will in fact be an array with the following items:
ROOT
|--> GENERIC
|--> ERRORMESSAGES
|--> ...
|--> SESSION
|--> ISEXPIRED
|--> ...
|--> REPLY
|--> The actual reply needed for the initial caller will go here...
I've seen that with .ajaxComplete(), I can in fact execute additional code which can be plugged into each ajax request that is being completed. Would I be able to - within that event handler - modify the ajax result so that only what is in my REPLY from the array we get back - is returned to the actual caller?
This would help me a lot as the ui.tabs for instance simply expect plain html to be returned and, sticking to this generic scheme, I would be able to make sure that the REPLY only is being returned to the tabs code initiating the ajax call...
I'm not sure it all makes sense, but I hope it does :)
thanks!!!
David.