Solved

date of an html file

Posted on 1999-01-19
5
211 Views
Last Modified: 2013-11-18
Is there any way we can include the date of the html file automatically??

Also, is it possible to check the date of a file (other than the html itself) and put it into a html??

TIA
-=Terence=-
0
Comment
Question by:kachan
  • 3
5 Comments
 
LVL 1

Expert Comment

by:chump
ID: 1845427
If your Server handles "Server Side Includes" (SSI), put a
 <!--#flastmod file="foo.html" -->
in your HTML-Code.
(more info on SSI using Apache Webserver can be found here:
http://www.apacheweek.com/features/ssi).

0
 
LVL 1

Expert Comment

by:chump
ID: 1845428
If you like to use JavaScript, you can also use this code for the date of the current HTML-File:

<SCRIPT LANGUAGE="JavaScript">
<!--
var x= new Date(document.lastModified);
document.writeln(x.toString());
// -->
</SCRIPT>

0
 

Author Comment

by:kachan
ID: 1845429
In fact, the way that you shown can only indicate the date of the current html, but I am actually trying to get the date for a gif file that I am going to display.

TIA
-=Terence=-

0
 
LVL 1

Expert Comment

by:chump
ID: 1845430
True for the Javascript-part. But with SSI:
 <!--#flastmod file="displayed.gif" -->
or
 <!--#flastmod virtual="/pics/displayed.gif" -->

0
 

Accepted Solution

by:
DannyAyers earned 50 total points
ID: 1845431
Unfortunately there is not a suitable property in Javascript for images, although there is for document - so call the image as a document. A possible workaround would be along the lines of :

<SCRIPT language="javascript">
      window2=open("Cat.gif","secondWindow","scrollbars=no");
      window.document.write(window2.document.lastModified.toString());
      window.focus();
//      window2.close();
</SCRIPT>

with image Cat.gif in same dir.

This should work with a bit of tweaking - I had to click reload. The focus pulls the interesting window to front. At some point you probably will want the close(), but where it is (on my browser at least) it loses the value.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now