<script language="JavaScript" type="text/javascript"> //取得当前时间 function getNowTime(){ //取得当前时间 var now= new Date(); var year=now.getYear(); var month=now.getMonth()+1; var day=now.getDate(); var hour=now.getHours(); var minute=now.getMinutes(); var second=now.getSeconds(); var nowdate=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second; document.form.action="test2.jsp?param="+nowdate;//把获取的时间传给另一个页面,在另一个页面显示 document.form.submit(); } </script> |