Technology Programming

The Javascript Code for Inserting the Date Last Modified On

    Purpose

    • The "date last modified on" script is ideal for websites that frequently update information for visitors. For example, a sports site that updates scores can use this Javascript code to let visitors know when the game scores were last updated. This script also adds credibility to a site by letting visitors know that it is frequently updated with new information. A stale site that never changes can turn off visitors and harm the chance of repeat visitors. Thus, automatically adding the time and date for which a Web page was last modified keeps up the appearance of freshness.

    Code Text

    • Javascript codes are similar to HTML. They look like gibberish to the uninformed, but that is not a problem. When accurately placing the code in your website files, it works whether or not you understand the technical details of the script. The following lines of code comprise an actual Javascript to insert the date and "last modified on" message:

      <SCRIPT LANGUAGE="JavaScript">
      <!--
      var date
      date=document.lastModified
      document.write("Last Modified on "+date)
      // -->
      </SCRIPT>

    Modifying the Display

    • You may alter the "Last modified on" text to fit your own situation. Look inside the Javascript for those words and replace them with any message you like. For example, if you are updating stock market information, you could change it to "stock market prices last updated on." As usual, the script will automatically include the date and time for you. Make any desired text changes before placing the code in your website files.

    Deploying the Code

    • This "date modified on" Javascript goes inside the HTML body tags of the web page for which you want the message and date to appear. The body refers to the text that actually appears in browsers when someone visits the page. Look for the <body> and </body> tags in the HTML file and place the code in relation to the other text inside those body tags.

SHARE
RELATED POSTS on "Technology"
WordPress - How to Set up a New Theme to WordPress 3.
WordPress - How to Set up a New Theme to WordPress 3.
Solution of Creative Web Design
Solution of Creative Web Design
The three disciplines of User Experience
The three disciplines of User Experience
Web Design Sheffield Options For Professional Enterprises
Web Design Sheffield Options For Professional Enterprises
Do you have what it takes?
Do you have what it takes?
Segway Cost
Segway Cost
Microsoft Access 2010: What's Coming with Office 2010?
Microsoft Access 2010: What's Coming with Office 2010?
Companies of Web Development in Ireland Provide Designs that Work
Companies of Web Development in Ireland Provide Designs that Work
Penguin Update to Put Red-Flags on Negative SEO
Penguin Update to Put Red-Flags on Negative SEO
Innovative web 2 design templates can make your business famous quickly
Innovative web 2 design templates can make your business famous quickly
Building A Search Engine Friendly Website
Building A Search Engine Friendly Website
Exceptional Advice To Build Up Your Internet Marketing
Exceptional Advice To Build Up Your Internet Marketing
The Benefits of Selecting The Right Hosting Company
The Benefits of Selecting The Right Hosting Company
Is There a Methodology for Making Successful Logos
Is There a Methodology for Making Successful Logos
Benefits of Ruby On Rails Development
Benefits of Ruby On Rails Development
The Power of Colour and Shapes in Your Infant's Life.
The Power of Colour and Shapes in Your Infant's Life.
Advantages of Hiring PSD To HTML Service Providers
Advantages of Hiring PSD To HTML Service Providers
How to Make Responsive Web Design Attractive?
How to Make Responsive Web Design Attractive?
Converting PSD to Responsive HTML
Converting PSD to Responsive HTML
Just a few realy really hints and tips when it comes to website design but look for.
Just a few realy really hints and tips when it comes to website design but look for.

Leave Your Reply

*