Home  >  Article  >  Web Front-end  >  js显示时间 js显示最后修改时间_javascript技巧

js显示时间 js显示最后修改时间_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:44:411078browse

本实例将实现显示网页文件最后的修改时间。首先在页面添加了一个文本框控件,然后使用javascript创建了一个函数,在函数中调用document对象的lastModified属性,然后在页面的文本框中显示文件上一次被修改的时间,通过这种方法可以查看网页的更新时间。
实现过程
1.编写自定义函数,代码如下:

复制代码 代码如下:



2.添加页面HTML代码,在body的onLoad事件中调用alterdate()函数,代码如下:
复制代码 代码如下:




上一次修改此文件的时间为:








Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn