code: function encodeQueryData(obj, prefix) {
            var str = [];
            for (var p in obj) {
              if (obj.hasOwnProperty(p)) {
                var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
                str.push(typeof v === 'object' ? encodeQueryData(v, k) : encodeURIComponent(k) + '=' + encodeURIComponent(v));
              }
            }
            return str.join('&');
          }
docs: http://stackoverflow.com/a/1714899/1885921