Guest jtoara Posted May 30, 2006 Share Posted May 30, 2006 I'm trying to dynamically display the latest file based on the modification date using javascript in one of my .html...Basically i had this html file that links to a text file...there are few text files in the folder..I wanted the link on my html page to be updated/link to the current text file automatically based on the date of the external file.Can anyone give me some hints?Much appreciated .....I assume it's somewhere along those line but got stuck:<script language="JavaScript">// <!-- date = new Date(); minute = date.getMinutes();// --></SCRIPT></HEAD><BODY><script language="JavaScript">//<!-- if (minute > 2) {document.write('<!--')}//--></script></body></html> Link to comment Share on other sites More sharing options...
asylum Posted May 30, 2006 Share Posted May 30, 2006 I'm fairly certain you need a server-side language to get file information. The only file information support javascript has to my knowledge is loading xml and xhtml files into javascript Document objects. Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 2, 2006 Share Posted June 2, 2006 asylum is right JavaScript can only manipulate pages and not do anything about the file theirselves.You'd need PHP for example Much easier to use in this situation Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now