jsp 拾零

1、获得当前时间
<body onload="showDate()">

function showDate()  
{  
var today = new Date();  
var day = today.getDate();  
var month = today.getMonth() + 1;  
var year = today.getYear();  
var date = year + "-" + month + "-" + day;  
document.getElementsByName('XXX').value = date;  


2、返回上一页面
<%@ page contentType="text/html; charset=GBK"%>
<html>
<head>
<title>Test</title>
</head>
<body>
<input type="button" class="button_ty" name="policySelect" value="返回" onClick="window.history.go(-1)">
</body>
</html>

后面的-1或-2是说明返回前几个页面。



你可能感兴趣的:(html,jsp)