| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1347 人关注过本帖
标题:为什么浏览器里不能显示
只看楼主 加入收藏
午夜风铃
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2004-9-21
收藏
 问题点数:0 回复次数:1 
为什么浏览器里不能显示

该程序的原代码如下

<HTML> <HEAD> <title>编写javascript脚本</title>

<SCRIPT Language="JavaScript"> today=new Data(); thehour=today.getHours(); theminute=today.getMinutes(); thesecond=today.getSeconds(); document.write("<h2>"+"现在是北京时间"+thehour+"点"+theminuter+ "分"+thesecond+"秒"+"<h2>") document.write("<p>") if(thehour<6) document.write(凌晨好!); else if(thehour<9) document.write("早上好"); else if(thehour<12) document.write("上午好"); else if(thehour<14) document.write("中午好"); else if(thehour<17) document.write("下午好"); else if(thehour<19) document.write("傍晚好"); else if(thehour<22) document.write("晚上好"); else document.write("夜里好"); </SCRIPT> </HEAD> <BODY></BODY>

</HTML>

用IE打开后为什么什么也看不到

搜索更多相关主题的帖子: 浏览器 
2004-09-21 12:41
zhzhwe
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2004-9-25
收藏
得分:0 

<HTML> <HEAD> <title>编写javascript脚本</title>

<SCRIPT Language="JavaScript"> today=new Date(); thehour=today.getHours(); theminute=today.getMinutes(); thesecond=today.getSeconds(); document.write("<h2>"+"现在是北京时间"+thehour+"点"+theminute+"分"+thesecond+"秒"+"<h2>") document.write("<p>")

if(thehour<6) document.write("凌晨好!"); else if(thehour<9) document.write("早上好"); else if(thehour<12) document.write("上午好"); else if(thehour<14) document.write("中午好"); else if(thehour<17) document.write("下午好"); else if(thehour<19) document.write("傍晚好"); else if(thehour<22) document.write("晚上好"); else document.write("夜里好"); </SCRIPT> </HEAD> <BODY> </BODY>

</HTML>

首先"Data();"写错了.应该"Date();"

其次"凌晨好"三个字没加引号啊,你看看现在行了嘛>?


2004-09-26 00:24
快速回复:为什么浏览器里不能显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016560 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved