网页显示上次登录时间_如何查找网页的上次修改时间

网页显示上次登录时间

When you’re reading content on the Web, it’s often useful to know when that content was last modified to get an idea of whether it may be outdated. When it comes to blogs, most include dates of publication for new content posted. The same is true for many news sites and news articles.

当您在Web上阅读内容时,了解该内容的最新修改时间通常很有用,以了解它是否过时。 当涉及博客时,大多数都包含发布新内容的发布日期。 许多新闻站点和新闻文章也是如此。

Some pages, however, don’t offer a date for when a page was last updated. A date isn’t necessary for all pages—some information is evergreen. But in some cases, knowing the last time a page was updated is important.

但是,某些页面没有提供页面上次更新的日期。 日期并不是所有页面都必需的,某些信息是常绿的。 但是在某些情况下,了解页面的上一次更新很重要。

Even though a page may not include a “last updated” date, there is a simple command that will tell you this, and it doesn’t require you to have a lot of technical knowledge.

即使页面可能不包含“上次更新”日期,也有一个简单的命令可以告诉您这一点,并且它不需要您具有很多技术知识。


JavaScript命令以显示上次修改的日期 ( JavaScript Command to Display the Date of the Last Modification )

To get the date of the last update on a page you’re currently, on, simply type the following command into the address bar of your browser and press Enter or select the Go button:

要获取当前页面上的最新更新日期,只需在浏览器的地址栏中键入以下命令,然后按Enter或选择“执行按钮:


javascript:alert(document.lastModified)

A JavaScript alert window will pop open displaying the last date and time the page was modified.

将弹出一个JavaScript警报窗口,显示修改页面的最后日期和时间。

For users of the Chrome browser and some others, if you cut-and-paste the command into the address bar, be aware that the “javascript:” part is removed. This doesn’t mean you can’t use the command. You will just need to type that bit back into the command in the address bar.

对于Chrome浏览器和其他浏览器的用户,如果您将命令剪切并粘贴到地址栏中,请注意,“ javascript:”部分已删除。 这并不意味着您不能使用该命令。 您只需要在地址栏中的命令中键入该位即可。


当命令不起作用时 ( When the Command Doesn’t Work )

Technology for web pages changes over time, and in some cases the command to find out when a page was last modified won’t work. For example, it won’t work on sites where the page content is generated dynamically. These types of pages are, in effect, being modified with each visit, so this trick doesn’t help in these cases.

网页技术会随着时间的推移而变化,在某些情况下,用于查找页面上次修改时间的命令将不起作用。 例如,它不适用于动态生成页面内容的网站。 实际上,这些类型的页面在每次访问时都会被修改,因此,在这种情况下,此技巧无济于事。


另一种方法:Internet存档 ( An Alternative Method: The Internet Archive )

Another means of finding when a page was last updated is using the Internet Archive, also known as the “Wayback Machine.” In the search field at the top, enter the full address of the web page you want to check, including the “http://” part.

查找页面上次更新时间的另一种方法是使用Internet存档 ,也称为“回溯机器”。 在顶部的搜索字段中,输入要检查的网页的完整地址,包括“ http://”部分。

This won’t give you a precise date, but you may be able to get an approximate idea of when it was last updated. Note, though, that the calendar view on the Internet Archive site only indicates when the Archive has “crawled” or visited and logged the page, not when the page was updated or modified.

这不会给您确切的日期,但是您也许可以大致了解它的最新更新时间。 但是请注意,Internet存档站点上的日历视图仅指示存档何时“爬网”或访问并记录了该页面,而不指示何时更新或修改了该页面。


向您的网页添加上次修改日期 ( Adding a Last Modified Date to Your Web Page )

If you have a webpage of your own, and you would like to show visitors when your page was last updated, you can do this easily by adding some JavaScript code to your page’s HTML document.

如果您拥有自己的网页,并且想向访问者显示页面的最新更新时间,则可以通过向页面HTML文档中添加一些JavaScript代码来轻松地做到这一点。

The code utilizes the same call shown in the previous section: document.lastModified:

该代码利用上一节中显示的相同调用:document.lastModified:

This will display text on the page in this format:

这将以以下格式在页面上显示文本:


Last updated on 08/09/2016 12:34:12

You can customize the text preceding the date and time displayed by changing the text between the quotation marks—in the above example, that is the “Last updated ” text (note that there is a space after “on” so that the date and time aren’t displayed abutting the text).

您可以通过在引号之间更改引号来自定义显示的日期和时间之前的文本,在上面的示例中,即“最近更新的”文本(请注意,“开”之后有一个空格,因此日期和时间不会在文字旁边显示)。

翻译自: https://www.thoughtco.com/how-to-find-when-a-web-page-was-last-modified-4071739

网页显示上次登录时间

    原文作者:cumao2792
    原文地址: https://blog.csdn.net/cumao2792/article/details/108575860
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞