什么是网页代码?怎么做电子网页?
发布网友
发布时间:2022-04-23 12:53
我来回答
共3个回答
热心网友
时间:2023-10-14 07:25
网页代码包括很多种,但都离不开html代码。这些代码让电脑明白你想把网页做成什么样子,然后ie就按照你代码的意思去显示。html代码是最基本的网页代码,比如说:<html><head></head><body></body></html>就是它的代码框架。如果你想知道更多,去搜索一下html入门就有很多材料。
当然,html代码的功能是有限的,于是,出现了其他的网页代码来超越它。如门槛较低的asp代码,你去百度百科一搜索,就明白了。诸如此类可以超越html的代码,还有jsp;php;aspx等。它们都可以实现比html更复杂的功能,如bbs论坛功能。
做一个最简单的电子网页,当然首先是用html代码来写了。不过,对于新手来说,还到不了那个深度,所以你就要借助一些可视化软件来实现,最经典的莫过于是老微软的Frontpage了。你去安装一个完整版的office2003软件,就有它咯。但现在最流行的软件不是它,且是DreamWeaver。
如何用DreamWeaver呢?http://www.enet.com.cn/eschool/zhuanti/dwvip/
这里,一定可以成就有心人!
如果还想继续问,在百度上留言给我!或者补充问题,留下你的叩叩号。
热心网友
时间:2023-10-14 07:25
网页的制作离不开代码,如果想制作出一个较好的网页,那代码必不可少。现在我们制作网页所用的代码都有HTML,JavaScript,ASP等。其最基础的就是HTML代码了。网页代码是网站展示内容的载体,是网站必不可少的一部分。最简单制作软件就是Dreamweaver系列的,可以做一些静态的网页。电子网页应该是把你所要呈现的内容以浏览器方式打开。还有什么疑问可以Q我。767159396。我就是搞网站开发的。
热心网友
时间:2023-10-14 07:26
我虽然不知道什么是电子网页,但唔可以制作单机网页,代码如下:
<html>
<head>
<title>计算出生时间</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
--></style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body OnLoad="startclock()">
<br>
<br>
<center><font color=red face="隶书" size=6>计算出生时间</font></center>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>
<tr><td align=center height=80>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var mm = prompt('请输入你出生的月份?','1-12');
var bday = prompt('请输入你出生在哪一天?','1-31');
var byear = prompt('请输入你出生的年份?','1975');
var year = new Date();
var year2 = year.getYear();
var year3 = (year < 2000) ? year2 + 1900 : year2;
thedate = new Date();
mm2 = thedate.getMonth() + 1;
dd2 = thedate.getDate();
yy2 = thedate.getYear();
if (yy2 < 100) yy2 += 1900
yourage = yy2 - byear;
if (mm2 < mm) yourage--;
if ((mm2 == mm) && (dd2 < bday)) yourage--;
TMonth = new Array(
'January','February','March',
'April','May','June','July',
'August','September','October',
'November','December'
);
CurMonth = mm - 1;
bmonth = TMonth[CurMonth];
var age2 = yourage + 1;
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var enday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
function stopclock() {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock() {
stopclock();
showtime();
showtime1();
}
function showtime() {
today = new Date();
enday = new Date(""+bmonth+", "+bday+" "+year3+" 00:00");
enday.setYear(""+year3+"");
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (enday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((enday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((enday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((enday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " 天, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " 小时, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " 分, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " 秒"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.down.face.value = timeRemain;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
if (daysRemain < 0) year3 = year3 + 1
}
function showtime1() {
startday = new Date(""+bmonth+" "+bday+", "+byear+" 00:00 EDT");
startday.setYear(""+byear+"");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " 天, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " 小时, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " 分, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " 秒"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.up.face.value = timeRemain;
timerID = setTimeout("showtime1()",1000);
timerRunning = true;
}
// End -->
</script>
<form name="down" onSubmit="0">
<script Language="JavaScript">
document.write("<b>你出生于"+bmonth+" "+bday+", "+byear+". ("+mm+"/"+bday+"/"+byear+")</b>");
document.write("<br><br>你已经 "+yourage+" 岁了,离你生日还有.");
</script>
<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
<p>
<br>
<form name="up" onSubmit="1">
你已经生活了...<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
</td></tr></table></center>
<br>
<br>
<center>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
<FORM METHOD="post">
</form>
</center>
<script language="JavaScript" src="http://www.7stk.com/store/ad/daima03.js"></script>
<br>
<center>
<textarea name=source rows=12 cols=55 class=yk9>
脚本说明:
第一步:把如下代码加入<body>区域中:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var mm = prompt('What month were you born in?','1-12');
var bday = prompt('What day were you born on?','1-31');
var byear = prompt('What year were you born in?','1975');
var year = new Date();
var year2 = year.getYear();
var year3 = (year < 2000) ? year2 + 1900 : year2;
thedate = new Date();
mm2 = thedate.getMonth() + 1;
dd2 = thedate.getDate();
yy2 = thedate.getYear();
if (yy2 < 100) yy2 += 1900
yourage = yy2 - byear;
if (mm2 < mm) yourage--;
if ((mm2 == mm) && (dd2 < bday)) yourage--;
TMonth = new Array(
'January','February','March',
'April','May','June','July',
'August','September','October',
'November','December'
);
CurMonth = mm - 1;
bmonth = TMonth[CurMonth];
var age2 = yourage + 1;
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var enday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
function stopclock() {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock() {
stopclock();
showtime();
showtime1();
}
function showtime() {
today = new Date();
enday = new Date(""+bmonth+", "+bday+" "+year3+" 00:00");
enday.setYear(""+year3+"");
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (enday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((enday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((enday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((enday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.down.face.value = timeRemain;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
if (daysRemain < 0) year3 = year3 + 1
}
function showtime1() {
startday = new Date(""+bmonth+" "+bday+", "+byear+" 00:00 EDT");
startday.setYear(""+byear+"");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.up.face.value = timeRemain;
timerID = setTimeout("showtime1()",1000);
timerRunning = true;
}
// End -->
</script>
<form name="down" onSubmit="0">
<script Language="JavaScript">
document.write("<b>你出生于"+bmonth+" "+bday+", "+byear+". ("+mm+"/"+bday+"/"+byear+")</b>");
document.write("<br><br>你已经 "+yourage+" 了,离你生日还有.");
</script>
<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
<p>
<br>
<form name="up" onSubmit="1">
你已经生活了...<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
第二步:把<body>区域中的内容改为:
<body bgcolor="#fef4d9" OnLoad="startclock()">
</textarea>
<br>
<br>
<IFRAME border=0 name=I1 marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_wenzi_shijian_caidan.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>
</body>
</html>
写成html格式就行了
热心网友
时间:2023-10-14 07:25
网页代码包括很多种,但都离不开html代码。这些代码让电脑明白你想把网页做成什么样子,然后ie就按照你代码的意思去显示。html代码是最基本的网页代码,比如说:<html><head></head><body></body></html>就是它的代码框架。如果你想知道更多,去搜索一下html入门就有很多材料。
当然,html代码的功能是有限的,于是,出现了其他的网页代码来超越它。如门槛较低的asp代码,你去百度百科一搜索,就明白了。诸如此类可以超越html的代码,还有jsp;php;aspx等。它们都可以实现比html更复杂的功能,如bbs论坛功能。
做一个最简单的电子网页,当然首先是用html代码来写了。不过,对于新手来说,还到不了那个深度,所以你就要借助一些可视化软件来实现,最经典的莫过于是老微软的Frontpage了。你去安装一个完整版的office2003软件,就有它咯。但现在最流行的软件不是它,且是DreamWeaver。
如何用DreamWeaver呢?http://www.enet.com.cn/eschool/zhuanti/dwvip/
这里,一定可以成就有心人!
如果还想继续问,在百度上留言给我!或者补充问题,留下你的叩叩号。
热心网友
时间:2023-10-14 07:25
网页的制作离不开代码,如果想制作出一个较好的网页,那代码必不可少。现在我们制作网页所用的代码都有HTML,JavaScript,ASP等。其最基础的就是HTML代码了。网页代码是网站展示内容的载体,是网站必不可少的一部分。最简单制作软件就是Dreamweaver系列的,可以做一些静态的网页。电子网页应该是把你所要呈现的内容以浏览器方式打开。还有什么疑问可以Q我。767159396。我就是搞网站开发的。
热心网友
时间:2023-10-14 07:26
我虽然不知道什么是电子网页,但唔可以制作单机网页,代码如下:
<html>
<head>
<title>计算出生时间</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
--></style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body OnLoad="startclock()">
<br>
<br>
<center><font color=red face="隶书" size=6>计算出生时间</font></center>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>
<tr><td align=center height=80>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var mm = prompt('请输入你出生的月份?','1-12');
var bday = prompt('请输入你出生在哪一天?','1-31');
var byear = prompt('请输入你出生的年份?','1975');
var year = new Date();
var year2 = year.getYear();
var year3 = (year < 2000) ? year2 + 1900 : year2;
thedate = new Date();
mm2 = thedate.getMonth() + 1;
dd2 = thedate.getDate();
yy2 = thedate.getYear();
if (yy2 < 100) yy2 += 1900
yourage = yy2 - byear;
if (mm2 < mm) yourage--;
if ((mm2 == mm) && (dd2 < bday)) yourage--;
TMonth = new Array(
'January','February','March',
'April','May','June','July',
'August','September','October',
'November','December'
);
CurMonth = mm - 1;
bmonth = TMonth[CurMonth];
var age2 = yourage + 1;
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var enday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
function stopclock() {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock() {
stopclock();
showtime();
showtime1();
}
function showtime() {
today = new Date();
enday = new Date(""+bmonth+", "+bday+" "+year3+" 00:00");
enday.setYear(""+year3+"");
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (enday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((enday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((enday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((enday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " 天, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " 小时, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " 分, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " 秒"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.down.face.value = timeRemain;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
if (daysRemain < 0) year3 = year3 + 1
}
function showtime1() {
startday = new Date(""+bmonth+" "+bday+", "+byear+" 00:00 EDT");
startday.setYear(""+byear+"");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " 天, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " 小时, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " 分, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " 秒"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.up.face.value = timeRemain;
timerID = setTimeout("showtime1()",1000);
timerRunning = true;
}
// End -->
</script>
<form name="down" onSubmit="0">
<script Language="JavaScript">
document.write("<b>你出生于"+bmonth+" "+bday+", "+byear+". ("+mm+"/"+bday+"/"+byear+")</b>");
document.write("<br><br>你已经 "+yourage+" 岁了,离你生日还有.");
</script>
<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
<p>
<br>
<form name="up" onSubmit="1">
你已经生活了...<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
</td></tr></table></center>
<br>
<br>
<center>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
<FORM METHOD="post">
</form>
</center>
<script language="JavaScript" src="http://www.7stk.com/store/ad/daima03.js"></script>
<br>
<center>
<textarea name=source rows=12 cols=55 class=yk9>
脚本说明:
第一步:把如下代码加入<body>区域中:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var mm = prompt('What month were you born in?','1-12');
var bday = prompt('What day were you born on?','1-31');
var byear = prompt('What year were you born in?','1975');
var year = new Date();
var year2 = year.getYear();
var year3 = (year < 2000) ? year2 + 1900 : year2;
thedate = new Date();
mm2 = thedate.getMonth() + 1;
dd2 = thedate.getDate();
yy2 = thedate.getYear();
if (yy2 < 100) yy2 += 1900
yourage = yy2 - byear;
if (mm2 < mm) yourage--;
if ((mm2 == mm) && (dd2 < bday)) yourage--;
TMonth = new Array(
'January','February','March',
'April','May','June','July',
'August','September','October',
'November','December'
);
CurMonth = mm - 1;
bmonth = TMonth[CurMonth];
var age2 = yourage + 1;
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var enday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
function stopclock() {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock() {
stopclock();
showtime();
showtime1();
}
function showtime() {
today = new Date();
enday = new Date(""+bmonth+", "+bday+" "+year3+" 00:00");
enday.setYear(""+year3+"");
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (enday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((enday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((enday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((enday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.down.face.value = timeRemain;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
if (daysRemain < 0) year3 = year3 + 1
}
function showtime1() {
startday = new Date(""+bmonth+" "+bday+", "+byear+" 00:00 EDT");
startday.setYear(""+byear+"");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.up.face.value = timeRemain;
timerID = setTimeout("showtime1()",1000);
timerRunning = true;
}
// End -->
</script>
<form name="down" onSubmit="0">
<script Language="JavaScript">
document.write("<b>你出生于"+bmonth+" "+bday+", "+byear+". ("+mm+"/"+bday+"/"+byear+")</b>");
document.write("<br><br>你已经 "+yourage+" 了,离你生日还有.");
</script>
<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
<p>
<br>
<form name="up" onSubmit="1">
你已经生活了...<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
第二步:把<body>区域中的内容改为:
<body bgcolor="#fef4d9" OnLoad="startclock()">
</textarea>
<br>
<br>
<IFRAME border=0 name=I1 marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_wenzi_shijian_caidan.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>
</body>
</html>
写成html格式就行了