Forum Moderators: open
For example if a site is updated with a fresh new article you would see...posted 1 minute ago and if you would return 3 days later you would see.....72 hours and 5 minutes ago. Or just 3 days ago!
I think you know what i mean, it is something that is widely used and would also like to have this kind of feature on my site but don't know how to do this or what kind of script i need to use for this, don't even know how such a script is called.
MichaelBlueJay was so kind to post this:
Actually I guess you could do the entire thing with Javascript. Here's the basic structure:
---------
<HTML><HEAD>
<script type="text/javascript">
function printElapsedTime(startingDate) {
(code to figure the elapsed time goes here)
document.write('Posted ' + elapsedTime + ' days ago');
}
</script>
</HEAD>
<BODY>
<P>blah blah blah
<script type="text/javascript">printElapsedTime('7-20-05')</script>
<P>blah blah blah
</BODY>
</HTML>
I'm going to place different snippets of news articles that are going to be placed on the homepage and from there you can click on the brief description and read the whole story....but how do i make this work for these different short descriptions that are going to be posted on various times, how do i combine this script with brief these descriptions?
(the brief description will be displaying the time ago posted message) :)