专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 其他开发语言

网页代码怎么测试

发布时间:2011-06-30 07:27:14 文章来源:www.iduyao.cn 采编人员:星星草
网页代码如何测试
写了几个网页代码,但是达不到我要的效果。我是直接用记事本写的,不知道怎么测试网页代码哦。有什么软件吗?

代码如下:
<html>
<head>
<title>动态时钟
</title>
<script language="javascript">
function clock()

  nowtime=new Date();
  with(nowtime)
  {
  mytimer.innertext="现在时间是:"+ getHours()+ ":"+ getMinutes() + ":" + getSeconds();
  }
}
</script>
</head>
<body onLoad="serInterval('clock()',1000);">
<p id="mytimer" align="center"></p>
</body>
</html>


就想制作个动态时钟,但是页面上什么也没显示。求高手指导!

------解决方案--------------------
保存为后缀名为html的文件,然后在浏览器中可以查看效果了
------解决方案--------------------
这个是能用的动态时钟:

JScript code

<html>
<head>
<title>动态时钟</title>
</head>
<body>
<div id="clock"></div>
<script type="text/javascript">
var now=new Date();
var clock=document.getElementById("clock");
function fillZeros(inValue){
if(inValue>9)
return ":"+inValue;
else
return ":0"+inValue;
}
showTime();
function showTime(){
var now=new Date();
clock.innerHTML=now.getHours()+fillZeros(now.getMinutes())+fillZeros(now.getSeconds());
setTimeout("showTime()",1000);
}
</script>
</body>
</html>

------解决方案--------------------
浏览器里就可以测试啊,你保存为网页文件,双击打开就可以了,IIS是服务器啊,你这个用不着的,除非你要做自己的服务器才需要安装IIS
------解决方案--------------------
直接浏览器下可以用alert(0),alert(1)这样的方式让JS自己报错
或者你可以用一些专门的工具:firefox下用firedug,IE下用Microsoft Debugger
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: