Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

Availability


JavaScript 1.0


Synopsis

document.lastModified

Description


lastModified is
a read-only string property that contains
the date and time at which document was
most recently modified. This data is derived from HTTP header data
sent by the web server. The web server generally obtains the
last-modified date by examining the modification date of the file
itself.

Web servers are not required to provide last-modified dates for the
documents they serve. When a web server does not provide a
last-modified date, JavaScript assumes 0, which translates to a date
of midnight, January 1, 1970, GMT. The following example shows how
you can test for this case.


Example


It is a good idea to let readers know how recent the information you
provide on the Web is. You can include an automatic timestamp in your
documents by placing the following script at the end of each HTML
file. Doing this means you do not need to update the modification
time by hand each time you make a change to the file. Note that this
script tests that the supplied date is valid before displaying it:

<script>
if (Date.parse(document.lastModified) != 0)
document.write('<p><hr><small><i>Last modified: '
+ document.lastModified
+ '</i></small>');
</script>


See Also


The Document location,
referrer, and title properties

/ 844