guestbook guestbook
guestbook Home! Psg! Svenska! Jvsc

Testing document.lastModified

and Counters, Date and Time


This page contains several tests using JavaScript.

The results depend both on the server and on what web browser you are using.

Sorry, you need a JavaScript capable browser to get the best from this page.



Test no. 1

date time

Here the Counter is used with these calls:
<IMG SRC="/cgi-bin/Count.cgi?ft=0|display=date|dformat=YYMMDD"
     NAME="Date_1" onError="Date_1.src='pix_xtra/datum_x1.gif'"
     alt="date" width=142 height=20>
<IMG SRC="/cgi-bin/Count.cgi?ft=0|display=clock|tformat=24|pad=Y"
     NAME="Time_1" onError="Time_1.src='pix_xtra/tid_x1.gif'"
     alt="time" width=69 height=20>


Test no. 2

Here the JavaScript function Date() is used:

var thisDate = new Date();

Test no. 3

Above the JavaScript function Date() is used:

var lastModDate = new Date(document.lastModified);

And if it reports the year as 1970 or undefined this function is used instead:

var lastModDate = new Date(operaParse(document.lastModified));

Where operaParse() is a function I have written to read the Date format in the Opera Web Bowser.

And if it reports the year as 1970 or undefined this function is used instead:

var lastModDate = new Date(hotjavaParse(document.lastModified));

Where hotjavaParse() is a function I have written to read the Date format in the HotJava Web Bowser.


Test no. 4

In the following example, the lastModified property is used in a <SCRIPT> tag in the BODY of an HTML file to display the modification date of the page:

The code looks like this:

document.write("This page updated on " + document.lastModified)

Somethig strange is going on, but what?
This is the server's answer:

Here lastModDate and operaModDate is defined as:

var lastModDate = new Date(document.lastModified);
var operaModDate = new Date(operaParse(document.lastModified));

Test no. 5

The adress (URL) of this page is:

Hera the JavaScript method document.URL is used:

document.write(document.URL);

Test no. 6

Visitor number:
counter
since 1998-09-06
or the latest reset.

The adress of the Counter image is:


gästbok Home! Psg! Svenska! Jvsc
© Bo Johansson 2001-09-03