AJAX Extension -POST Passes Parameters and Jumps Pages
Published: 2019-04-20
直接上扩展的代码
$.extend({
    StandardPost:function(url,args){
        var form = $("<form method='post'></form>"),
            input;
        form.attr({"action":url});
        $.each(args,function(key,value){
            input = $("<input type='hidden'>");
            input.attr({"name":key});
            input.val(value);
            form.append(input);
        });
        form.submit();
    }
});

simple call

$.StandardPost('url/path/req',{arg0:'arg0',arg1:'arg1'});