jQuery.ajax()'s processData option extension
Let users use functions for the processData option for $.ajax() (more importantly for $.ajaxSetup() ) for more advanced handling of data.
Here is what I've came up with:
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- if (typeof s.processData === "function") {
- s.data = s.processData(s.data)
- }else{
- s.data = jQuery.param( s.data, s.traditional );
- }
- }
What do you think?