title: How to trim JSON Object removing whitespace
body: <p>I hava a common ajax.post method which accepts data from function parameter. Now i want to trim the properties of data. Below is the code.</p>
  
  <pre><code>function PostToServer(options) {
      var defaults = {
          'url': null,
          'data': null,
          'onSuccess': null,
          'onError': null
      };
      var parameters = $.extend(defaults, options);
      $.ajax({
          url: parameters.url,
          type: "POST",
          data: JSON.stringify(parameters.data),
          contentType: "application/json",
          success: function (res) {
              if ($.isFunction(parameters.onSuccess)) {
                  parameters.onSuccess(res);
              }
          },
          error: function (xhr, status, error) {
              if ($.isFunction(parameters.onError)) {
                  parameters.onError(xhr, status, error);
              }
          }
      });
  }
  </code></pre>
  
  <p>Now in this function i want to trim the 'parameters.data' object so that it removes whitespace from both ends. but i dont know what comes in 'parameters.data' so i can not access its properties and use trim function.
  Please help.</p>