Search Members Help

» Welcome Guest
[ Log In :: Register ]

 

[ Track This Topic :: Email This Topic :: Print this topic ]

reply to topic new topic new poll
Topic: javascript help pls?< Next Oldest | Next Newest >
 Post Number: 1
masher Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 394
Joined: May 2000
PostIcon Posted on: Mar. 20 2001,23:20  Skip to the next post in this topic. Ignore posts   QUOTE

I have a small script at the bottom of the pages in my website to put the date that the file was last edited


<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non-Javascript browsers
document.write("<FONT FACE=\"arial\" SIZE=1>");
document.write('Last Updated ' + document.lastModified);

// Stop hiding from non-JavaScript Browsers -->
</SCRIPT>


The problem is that it doesn't work, something to do with the server settings...

quote:

The lastModified property is derived from the HTTP header data sent by the web server. Servers generally
obtain this date by examining the file's modification date.

The last modified date is not a required portion of the header, and some servers do not supply it. If the server
does not return the last modified information, JavaScript receives a 0, which it displays as January 1, 1970 GMT.


That was from http://developer.netscape.com/docs/manuals/js/client/jsref/document.htm#1193811

Is there another way of automatically rendering the date that the file was last edited? I don't feel like changing the date everytime I edit the file...

------------------
"The theory of gravitation is not responsible for people falling in love." - Einstein

Offline
Top of Page Profile Contact Info 
 Post Number: 2
hal0 Search for posts by this member.
I am almost one of Us.
Avatar



Group: Members
Posts: 167
Joined: Aug. 2000
PostIcon Posted on: Mar. 21 2001,00:56 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

quote:
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non-Javascript browsers
document.write("<FONT FACE=\"arial\" SIZE=1>");
document.write('Last Updated ' + document.lastModified);

// Stop hiding from non-JavaScript Browsers -->
</SCRIPT>


guessing here.. i'm not good at java.. cuz i hate it, but the first document.write has " quotes, while the second uses ' quotes.. try changing the second to " quotes

------------------
"that's even better! hot lesbian witches.. think about it, it's fucking genius!" - charlie sheen

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 3
masher Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 394
Joined: May 2000
PostIcon Posted on: Mar. 21 2001,02:34 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

the actual script itelf works. Its just that the server doesn't provide the information for the script to render the correct date.

I'm wondering if there is another way (javascript or otherwise) to do it, or do I have to put in the date manually?

------------------
"The theory of gravitation is not responsible for people falling in love." - Einstein

Offline
Top of Page Profile Contact Info 
 Post Number: 4
hal0 Search for posts by this member.
I am almost one of Us.
Avatar



Group: Members
Posts: 167
Joined: Aug. 2000
PostIcon Posted on: Mar. 21 2001,21:52 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

so it does show a date, but it doesn't show the date you want?

------------------
"that's even better! hot lesbian witches.. think about it, it's fucking genius!" - charlie sheen

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 5
masher Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 394
Joined: May 2000
PostIcon Posted on: Mar. 24 2001,11:13 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Netscape shows January 1, 1970 GMT.
IE shows the time that the page loaded.

------------------
"The theory of gravitation is not responsible for people falling in love." - Einstein

Offline
Top of Page Profile Contact Info 
 Post Number: 6
porn_dealer Search for posts by this member.
DetVet
Avatar



Group: Members
Posts: 207
Joined: May 2000
PostIcon Posted on: Mar. 25 2001,06:28 Skip to the previous post in this topic.  Ignore posts   QUOTE

Better yet, if your web server runs PHP, you can rename your page to .php and run the following code (insert it wherever you want it to go on the page):
code:

<?php
$lastmod = date("F d Y H:i:s", getlastmod());
echo "Last Modified".$lastmod;
?>

That should work.

------------------
Only you can prevent forum fires.

Offline
Top of Page Profile Contact Info WEB 
5 replies since Mar. 20 2001,23:20 < Next Oldest | Next Newest >

[ Track This Topic :: Email This Topic :: Print this topic ]


 
reply to topic new topic new poll

» Quick Reply javascript help pls?
iB Code Buttons
You are posting as:

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code