PDA

View Full Version : Ok, I don't get it . . .


desktopjockey
09-13-2002, 10:51 AM
I've inserted a small script into my page that is supposed to tell me the last modified date for the page I'm working on. The page gives me the last accessed date and time instead. What the !@#$ am I doing wrong?:(

Dynasty
09-13-2002, 10:59 AM
Well it is a bit hard to tell without seeing what you have so far.

Whoo over 100 go me !

desktopjockey
09-13-2002, 09:38 PM
What, is your crystal ball not working? I thought all us techies had crystal balls to see what others are thinking but not communicating! :p Here's what I've been using:

<SCRIPT>document.write("<FONT SIZE=-3>Updated " + document.lastModified)</SCRIPT>

Now, break me!
:D

By the way, my job is such that I went out and purchased a crystal ball for my desk just to be a smart a$$ :cool: My boss fell out of his chair he laughed so hard.

Dynasty
09-13-2002, 11:45 PM
Well when I tested it the date and time remained constant. However if you are looking at it in the internal preview bit of 1st page it will update because the preview file is recreated every time you use that page.

But that code does work on a webserver.

desktopjockey
09-14-2002, 06:05 AM
Ok, I'll take you up on that. However, go to this site: http://www.seabrooksites.com/bcog/ and check the date at the bottom of the page below the footer. It reports the time you accessed the file. If you view source, and check out the cell contents of the table, you will lsee the code I gave you earilier in this thread. I have not updated this file since before June, yet it has the current date and time. Can you see anything stupid in the code?

andy
09-14-2002, 07:44 AM
Bit strange that.. maybe something on the page is screwing up the code as in mozilla, you get the defaul 1 jan 1970. and in IE you get the current time/date

I just tried a test page and it seems to work ok here..

http://www.digital-ocean.co.uk/xcode/lastmod.html

andy
09-14-2002, 07:47 AM
I just had a thought.. is this a standard HTML page or some page built by the server, ie php,asp, shtml etc..??

ie if its built by the server, this internal lastmod setting will be reset

BoR|S
09-14-2002, 08:33 AM
Maybe... the last modified date depends on the server internal clock and if there is a problem with it, this might be the source for the problem, however, in mozilla I see Jan 1st 1970...

EnwTheGood
09-14-2002, 12:06 PM
I haven't used much Javascript in quite a while, but don't you need some sort of date formatting function for that?

BoR|S
09-14-2002, 12:23 PM
Well yes, but only after you get it from the function, you can use other JS script to format the date to show it the way you want to...

desktopjockey
09-14-2002, 07:12 PM
I viewed the source for Andy's page, and it's different than what I submitted in the thread. I'll "grand theft good idea" Andy's code and try it again. Any objections, please let me know.

All my webwork is hand made. I dont use "bloat"page by MS, or dreamweaver, etc. Just NoteTab, 1stPAge 2000, and PaintShop Pro are in my web arsenal.

Thanks for the info and thought folks. I love it here!:D

Waves
09-19-2002, 06:49 PM
This is the code I use. It works fine for me:

<script language="JavaScript" type="text/javascript">
<!--

document.write("Last Update:" + document.lastModified)

// -->
</script>

desktopjockey
09-19-2002, 07:14 PM
Snatched Andy's code, but got the same !@#$ results. I'm at a loss.

Waves code looks like the one I was using originally, but I will try anything at this point. I'm about to get into my little bag of xplosives for this one. :D

Sky
09-20-2002, 02:57 PM
Code--why? Why do yo uneed to know that? anywhoo, the explosives, A++ Idea! Cheers!