jQuery提交form表单
<form id="search_form" name="search_form" method="post"> <input type="text" name="username" /> </form>
<script type="text/javascript"> $(function() { $('#btn').bind('click', function() { document.search_form.action = 'admin/queryAll.do?pid=' + pid; //定义 action,并传參 $('#search_form').submit(); }); }) </script>
作者:itmyhome