首页 > 编程语言 > 详细

用就javascript脚本语言设计程序

时间:2014-04-02 21:01:26      阅读:649      评论:0      收藏:0      [点我收藏+]

        根据当天是星期几,在页面中显示不同的图片。

        源代码:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>日历</title>
</head>
 <body>
     <script language="javascript">
         var today=new Date();
    t=today.getDay();
    if(t==1)
    document.write("今天是星期一<p><img src=1.jpg>");
    if(t==2)
    document.write("今天是星期二<p><img src=2.jpg>");
    if(t==3)
    document.write("今天是星期三<p><img src=3.jpg>");
    if(t==4)
    document.write("今天是星期四<p><img src=4.jpg>");
    if(t==5)
    document.write("今天是星期五<p><img src=5.jpg>");
    if(t==6)
    document.write("今天是星期六<p><img src=6.jpg>");
    if(t==0)
    document.write("今天是星期日<p><img src=0.jpg>");
      </script>   
    </body>
</html>

用就javascript脚本语言设计程序,布布扣,bubuko.com

用就javascript脚本语言设计程序

原文:http://8435973.blog.51cto.com/8425973/1389252

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!