标题:HTML调用Js的函数只显示函数名
只看楼主
渐渐鱼
Rank: 1
等 级:新手上路
帖 子:80
专家分:0
注 册:2018-5-11
结帖率:90%
 问题点数:0 回复次数:1 
HTML调用Js的函数只显示函数名
程序代码:
function aaa()
{
var now=new Date();
var year = now.getFullYear();
var now = new Date();
var month = now.getMonth();
var now=new Date();
var day1=now.getDay();
var day;
switch(day1)
{
    case 1:
    day="星期一";
    break;
    case 2:
    day="星期二";
    break;
    case 3:
    day="星期三";
    break;
    case 4:
    day="星期四";
    break;
    case 5:
    day="星期五";
    break;
    case 6:
    day="星期六";
    break;
    case 7:
    day="星期日";
    break;
}
document.write(year);
document.write("/");
document.write(month);
document.write("/");
document.write(day1);
document.write("   ");
document.write(day);
}




然后调用的语句
 <div id="div3">
            <a href="#">首页&nbsp;&nbsp;|&nbsp;&nbsp;</a>
            <a href="#">笔记总结&nbsp;&nbsp;|&nbsp;&nbsp;</a>
            <a href="#">资源分享</a>
            aaa();
            <hr>
            </div>
搜索更多相关主题的帖子: var case break document write 
2018-06-08 20:06
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
得分:0 

 <div id="div3">
            <a href="#">首页&nbsp;&nbsp;|&nbsp;&nbsp;</a>
            <a href="#">笔记总结&nbsp;&nbsp;|&nbsp;&nbsp;</a>
            <a href="#">资源分享</a>
          <script> aaa();</script>
            <hr>
            </div>

http://toorup.3v.do
loading...
2018-09-26 11:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-487731-1-1.html




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

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