javascript and last modified date
javascript in my zope have problems with document dates: document.write(document.lastModified) returns 1970... Is there something I have forgotten? In zope or Linux (on which my zope is running) Einar -- Einar Næss Jensen Avdelingsingeniør EDB-HF 735 90750
Einar Næss Jensen wrote at 2003-2-21 13:13 +0100:
javascript in my zope have problems with document dates: document.write(document.lastModified)
returns 1970...
Is there something I have forgotten? In zope or Linux (on which my zope is running)
This looks like a pure Javascript question/problem with no Zope or Linux involved. Dieter
At 20:25 21.02.2003 +0100, Dieter Maurer wrote:
Einar Næss Jensen wrote at 2003-2-21 13:13 +0100:
javascript in my zope have problems with document dates: document.write(document.lastModified)
returns 1970...
Is there something I have forgotten? In zope or Linux (on which my zope is running)
This looks like a pure Javascript question/problem with no Zope or Linux involved.
I apologize. I assumed the javascript method somehow got hold on the "las modified date" from the webserver (but of courde: how it would do this I do not know). Einar
javascript in my zope have problems with document dates: document.write(document.lastModified)
returns 1970...
Is there something I have forgotten? In zope or Linux (on which my zope is running)
This looks like a pure Javascript question/problem with no Zope or Linux involved.
I apologize. I assumed the javascript method somehow got hold on the "las modified date" from the webserver (but of courde: how it would do this I do not know).
While document.lastModified is indeed a DOM thing, it doesn't seem unreasonable that Zope's property of similar name be available. I don't know where a browser would be expected to get that from specifically, though no doubt it's some HTTP header. A very-quick Mozilla search indicates it might be 'last-modified' in the response: http://lxr.mozilla.org/seamonkey/source/content/html/document/src/nsHTMLDocu... So try RESPONSE.setHeader('last-modified', some_time) with the document you're running your Javascript on and see what that does for you. I can't watch HTTP conversations right now, but if Zope doesn't try this, I think it probably should, and if it does, but it doesn't work, it should definitely be fixed. Consider filing a Collector issue in either case. (A quick Zope source search shows no instance of last-modified in ZPublisher.) Also, if you post the appropriate code fragments, others can test more easily to see if this is a problem with your setup or in general. --jcc
einar jensen wrote:
I apologize. I assumed the javascript method somehow got hold on the "las modified date" from the webserver (but of courde: how it would do this I do not know).
Most likely you would need to put some dtml into your html page for rendering a JavaScript date object. var lastModified = new Date('<dtml-var bobobase_modification_time>') That should probably be enough. regards Max M
participants (5)
-
Dieter Maurer -
einar jensen -
Einar Næss Jensen -
J Cameron Cooper -
Max M