<pre name="code" class="html"><form name="oper_tjg" method="post">
<input type="button" name="tran_1" οnclick="tran()" value="转发">
<input type="button" name="judg_1"οnclick="judg()" value='评论'>
<input type="button" name="good_1"οnclick="good()" value='点赞'>
</form>
<script type="text/javascript">
function tran() {
document.oper_tjg.action="tran.php";
document.oper_tjg.submit();
}
function judg() {
document.oper_tjg.action="tran.php";
document.oper_tjg.submit();
}
function good() {
document.oper_tjg.action="tran.php";
document.oper_tjg.submit();
}
</script>
这样点击无效果
<form name="oper_tjg" method="post"><input type="button" name="tran" οnclick="tran()" value="转发"><input type="button" name="judg"οnclick="judg()" value='评论'><input type="button" name="good"οnclick="good()" value='点赞'></form><script type="text/javascript">function tran() {document.oper_tjg.action="tran.php"; document.oper_tjg.submit();}function judg() {document.oper_tjg.action="";document.oper_tjg.submit();}function good() {document.oper_tjg.action=" ";document.oper_tjg.submit();}</script>这样才能能够生效