Edit in JSFiddle

// 以下を Zepto.js が読み込まれたあとの何処かに挿入
(function () {

    var escape = encodeURIComponent;

    function serialize(params, obj, traditional, scope) {
        var type, objIsArray = $.isArray(obj),
            objIsObject = $.isPlainObject(obj)
            $.each(obj, function (key, value) {
                type = $.type(value)
                if (scope) key = traditional ? scope : scope + '[' + (objIsObject || type == 'object' || type == 'array' ? key : '') + ']'
                // handle data in serializeArray() format
                if (!scope && objIsArray) params.add(value.name, value.value)
                // recurse into nested objects
                else if (type == "array" || (!traditional && type == "object")) serialize(params, value, traditional, key)
                else params.add(key, value)
            })
    }

    $.param = function (obj, traditional) {
        var params = []
        params.add = function (k, v) {
            this.push(escape(k) + '=' + escape(v))
        }
        serialize(params, obj, traditional)
        return params.join('&').replace(/%20/g, '+')
    }

})();
// 以上


var params = {
    pStr: 'hoge',
    pAry: [1, 2, 3],
    pAryObj: [{
        a: 'bc',
        d: 'ef'
    }, {
        a: 'gh'
    }]
};

echo(params);

function echo(obj) {
    var serialized = decodeURIComponent($.param(obj).replace(/&/g, '&\n'));
    $('#console').html(serialized);
}
<pre id="console"></pre>

              
            
          
            
              

External resources loaded into this fiddle: