function bool2Int(obj) { $.each(obj, function(i) { if (typeof obj[i] == 'object') { bool2Int(this); } else if (typeof obj[i] == 'boolean') { obj[i] = +obj[i]; } }); return obj; } $.ajaxSetup({ processData: false, beforeSend: function(xhr, settings) { settings.data = $.param(bool2Int(settings.data)) } });