日期:2014-05-16  浏览次数:20307 次

为什么内容在页面没有显示
JScript code
<html>
<head>
     <title>JS时间累加</title>
    <meta http-equiv = "refresh" content = "1">
     <script language="text/javascript">
    function getTime()
    {
        var objdate = new Date();
        var hour = objdate.getHours();
        var minute = objdate.getMinutes();
        var second = objdate.getSeconds();
        var time = hour +":" minute +":"+second;
        document.write("当前时间为: "+ time);
    }
    </script>
</head>
<body>
</body>
</html>


------解决方案--------------------
探讨
JScript code
<html>
<head>
<title>JS时间累加</title>
<meta http-equiv = "refresh" content = "1">
<script language="text/javascript">
function getTime()
{
var objdate = new D……

------解决方案--------------------
var time = hour +":" minute +":"+second;
少了+号。。
var time = hour +":" + minute +":"+second;