开发者

Web page "timestamp"

Is there a web site that can verify your web pages. Specifically, let's say you created a web page on Monday and you want your users to be assured that when they view the same page on Tuesday, that it's the same page that was posted on Mondya (without any modifications).

Thank yo开发者_开发技巧u.


To get the last modified data of a webpage, you can use the document.lastModified property with javascript.

In order to ensure your users, see:

  • How to display the last modified date


You can verify your own web pages with a little bit of javascript

<script type="text/javascript" language="JavaScript" src="lastupdated.js"></script>
<script type="text/javascript" language="JavaScript">
<!-- Write last modified date at the bottom of the page
var dateObj = new Date(document.lastModified)
var dateString = lastUpdated(dateObj)
document.write(dateString)
// -->
</script>

And this is the lastupdated JavaScript

function lastUpdated(dateObj)
{
var dayNames = new Array(8);
dayNames[1] = "Sunday";
dayNames[2] = "Monday";
dayNames[3] = "Tuesday";
dayNames[4] = "Wednesday";
dayNames[5] = "Thursday";
dayNames[6] = "Friday";
dayNames[7] = "Saturday";

var monthNames = new Array(13);
monthNames[1] = "January";
monthNames[2] = "February";
monthNames[3] = "March";
monthNames[4] = "April";
monthNames[5] = "May";
monthNames[6] = "June";
monthNames[7] = "July";  
monthNames[8] = "August";
monthNames[9] = "September";
monthNames[10] = "October";
monthNames[11] = "November";
monthNames[12] = "December";

var theDay = dayNames[dateObj.getDay() + 1];
var theMonth = monthNames[dateObj.getMonth() + 1];
var dayNumber = dateObj.getDate();
var fullYear = dateObj.getYear();
if (fullYear < 1900) { fullYear = fullYear + 1900 };
var dateString = '<center><font face="arial, helvetica" size="-3">' + "Last modified on " + theDay + ", " + theMonth + " " +         dayNumber + ", " + fullYear + " </font></center>";
return dateString;
} 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜