日期:2014-05-16 浏览次数:20322 次
<% Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); String newTime = sf.format(cal.getTime()); %> <table> <tr> <td> 查询时间: <input id="begintime" name="begintime" type="text" value="<%=newTime%>" maxlength="20" style="width:80px" readonly/> </td> </tr> </table> <script type="text/javascript"> $(document).ready(function() { var newTime = <%=newTime%>; alert(newTime); }); </script>
var newTime = <%=newTime%>;
------解决方案--------------------