< body> < p id =" lastModified">& nbsp;< / p> < / body> < / html>document.lastModified supported since JavaScript 1.0 by all everexisted / existing browsers (including Netscape and Opera) - so I don''tsee where could be any problem.If you are looking for a way to display the date nicely on the page,then something like:<html><head><title>Last Modified</title><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><script type="text/javascript">function showLastModified() {var out = document.getElementById(''lastModified'');var d = new Date();if (d.toLocaleDateString) {out.innerHTML = d.toLocaleDateString(document.lastModified);}else {out.innerHTML = document.lastModified;}}window.onload = showLastModified;</script></head><body><p id="lastModified"> </p></body></html> 应该有警告, 表示asp-pages [并且可能还有php-pages] 每次构建/呈现HTML新(!!!!), 以便不断变化的document.lastModified , 虽然是正确的,但不是很有用。 - Evertjan。 荷兰。 (用我的电子邮件地址替换所有带点的十字架)A warning should be in place,that "asp-pages" [and probably also "php-pages"]are constructed/rendered HTML new(!!!!) every time,so that the ever changing document.lastModified,while being correct, is not very usefull.--Evertjan.The Netherlands.(Replace all crosses with dots in my emailaddress) 一个好点! 我想正式它是正确的(?)因为document.lastModified 表示上次更改文档的* content *的时间。 如果是ASP,则在服务器端进行解析时发生。 也许是时候介绍一些新的物业,比如 lastTemplateModified? :-) 微软建议在这种情况下在服务器响应中明确设置Last-Modified标题 : < http://support.microsoft.com/kb/q165862/> 好像是一个很好的解决方法?A good point!I guess formally it''s correct (?) because document.lastModifiedindicates when the *content* of document has been last time changed.And in case of ASP it happened during the parsing on the server-side.Maybe it''s time to introduce some new property likelastTemplateModified ? :-)Microsoft suggests in such case to set Last-Modified header explicetlyin the server response:<http://support.microsoft.com/kb/q165862/>Seems like a nice workaround? 这篇关于document.lastModified的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!