"How Old Is The Internet" Widget

November 23rd, 2008 | Author: Chip

The Internet appeared in 1983. More detailed discussions on this subject are outside the scope of this article. We will learn how to create a JavaScript widget showing how old is the internet.

First of all, we need to write a prototype function of a date. As the JavaScript code is wrapping a bit weird with my theme, here is the finished .js file:

time.js

As the function is included in the head (either external or included), all we need to add is:

<script type="text/javascript">
	var oPast = new Date(1983, 1, 1, 0, 0);
	document.write(oPast.toTimeSinceString(6, ',  ', ' and '));
</script>

Download a .zip file with a finished HTML example.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled
Get Adobe Flash playerPlugin by wpburn.com wordpress themes