真正的页面是
http://192.168.1.251/floor/html/index.php?73.html
前面一个 html 是目录名。后面的 73.html 只不过是做为一个 get 变量名存在。。然后程序里判断这个变量名来改变内容显示。。
你自己不会写吗?
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">
<title>距离9月1日还有多少天</title>
<style type="text/css">
.body {
font-size: 18px
font-family: 微软雅黑, 宋体
}
</style>
</head>
<body>
<div class="body">
今天是:<a id="date"></a> , 距离9月1号还有:<a id="day"></a>天
</div>
<script type="text/javascript">
var date = document.getElementById("date")
var day = document.getElementById("day")
var da = new Date()
date.innerHTML = (da.getMonth() + 1) + "月" + da.getDate() + "号"
var mon=da.getMonth()+1
if(mon<10)
mon="0"+mon
var date=da.getDate()
if(date<10)
date="0"+date
day.innerHTML = getDayNumber("2015"+mon+date,"20150901")
function getDayNumber(date1, date2) {
var year1 = date1.substr(0, 4)
var year2 = date2.substr(0, 4)
var month1 = date1.substr(4, 2)
var month2 = date2.substr(4, 2)
var day1 = date1.substr(6, 2)
var day2 = date2.substr(6, 2)
temp1 = year1 + "/" + month1 + "/" + day1
temp2 = year2 + "/" + month2 + "/" + day2
var dateaa = new Date(temp1)
var datebb = new Date(temp2)
var date = datebb.getTime() - dateaa.getTime()
var time = Math.floor(date / (1000 * 60 * 60 * 24))
return time
}
</script>
</body>
</html>
<html><head>
</head>
<body>
<div id="timeshow">
</div>
<script type="text/javascript">
var time=new Date()
time.setHours(1)
time.setMinutes(30)
time.setSeconds(0)
var timeout
var timeshow=document.getElementById("timeshow")
function countdown(){
var hour=time.getHours()
var min=time.getMinutes()
var second=time.getSeconds()
if(hour=="0"&&min=="0"&&second=="0"){alert("Time Out!")clearInterval(timeout)}
time.setSeconds(second-1)
hour<10?hour="0"+hour:hour
min<10?min="0"+min:min
second<10?second="0"+second:second
timeshow.innerHTML=hour+":"+min+":"+second
}
timeout= setInterval(countdown,1000)
</script>
</body>
</html>
初学菜鸟 编的不好请指教
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)