$.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(); } });
简单的调用
$.StandardPost('url/path/req',{arg0:'arg0',arg1:'arg1'});原文链接:https://www.f2er.com/ajax/161925.html