Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 31, 2019 01:52 pm GMT

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.
Footer Sectionsrc: 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>   &copy   <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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To