jsp实现半小时的倒计时页面
Java代码
<%@ page language="java" pageEncoding="UTF-8"%>
<div id="leftTime"></div>
<script>
var leftTime = <%=Integer.parseInt("1800")%>;
function showLeftTime(){
var leftMinutes = parseInt(leftTime/60);
var leftSeconds = parseInt(leftTime%60);
if(leftTime < 0){
clearInterval(timer);
document.location.href = document.location.href;
//document.getElementById('leftTime').innerHTML = '';
}else{
document.getElementById('leftTime').innerHTML = ' 如未选择付费方式 ,剩余时间小于5分钟将不允许支付 ,剩余时间:'+leftMinutes+'分'+leftSeconds+'秒';
}
leftTime--;
}
var timer = setInterval('showLeftTime()',1000);
</script>
补充:软件开发 , Java ,