網頁底部的版權年份自動更新

對於html5的頁面而言,最簡單最短的代碼寫法:

<script>document.write(new Date().getFullYear())</script>

如果非要有一個開始的年份:

&copy; Copyright 2017<script>new Date().getFullYear()>2017&&document.write("-"+new Date().getFullYear());</script>, Company.

或者

&copy; Copyright 2010-<script>document.write(new Date().getFullYear())</script>, Company.
<p>Company &copy; <span id="year"></span> All Rights Reserved.</p>

 

如果是PHP的話:

<?php echo date('Y'); ?>

 

給TA打賞
共{{data.count}}人
人已打賞
源碼

Chevereto的百度鉴黄

2020-3-23 9:30:28

源碼

织梦精准搜索自定义字段搜索证书查询

2022-6-14 12:58:55

0 Reply AAuthor MManager
    暫無討論,說說你的看法吧
搜索