$(".exportBrandSort").on('click', function() { var url = contextPath+"/brand/exportBrandSort"; $('#searchform').attr('action', url); $('#searchform').submit(); //还原action值 url = contextPath+"/brand/getBrand"; $('#searchform').attr('action', url); });
$(".exportBrandSort").on('click', function() { var url = contextPath+"/brand/exportBrandSort"; var data= $('#searchform').serialize(); $.ajax({ type: 'GET', url: url, data: data, success:function(retJson){ } }); });
使用jQuery重用form表单并异步提交到其他action
原文地址:http://blog.csdn.net/kingson_wu/article/details/38927915