jquery构造from提交表单

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    var pams = [];  
    var customer = encodeURIComponent($.trim($('#customer').val()));  
    var age = $('#age').val();  
    var gender = $('#gender').val();  
    pams.push($('<input>', {name: 'age', value: age}));  
    pams.push($('<input>', {name: 'customer', value: customer}));  
    pams.push($('<input>', {name: 'gender', value: gender}));  
    pams.push($('<input>', {name: 'backurl', value: encodeURIComponent('/user/new')}));  
    $('<form>', {  
        method: 'post',  
        action: '/user/add.do'  
    }).append(pams).submit();