An Interest In:
Web News this Week
- April 14, 2024
- April 13, 2024
- April 12, 2024
- April 11, 2024
- April 10, 2024
- April 9, 2024
- April 8, 2024
December 31, 2019 01:52 pm GMT
Original Link: https://dev.to/saviour123/automating-the-date-on-your-footer-1g1i
Automating the Date On Your Footer.
In software engineering, it often said that, once you do any repetitive task, you need to look into automating it, so must the Copyright Date on the footer be automated.
Footer holds Details such as Sitemap, Social Links and Copyright Notice.
Eg.
src: https://www.godlife.com/en
By introducing a simple JavaScript tag, the year would correspond with the current year which means you don't have to change this every other year.
- Add the JS script to your HTML
document.write(new Date().getFullYear());
- Introduce a script tag in your Footer Section.
<p> © <script> document.write(new Date().getFullYear()); </script> <a href='https://twiter.com/saviour123>Saviour Gidi<a/> </p>
Output
2019 Saviour Gidi
Imagine every year you have to manually change the date on the website. It's not safe for your health and your company's and I pity you. To cut long story short, update your code to include the JS tag!
Original Link: https://dev.to/saviour123/automating-the-date-on-your-footer-1g1i
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To