kimber Posted June 17, 2020 Report Share Posted June 17, 2020 <script> function myFunction() { var x = document.lastModified; document.getElementById("demo").innerHTML = x; } </script> Can I attach this javascript to a html download link so it shows the last time the link (file) was updated? The links are like this: <a href="http://url.com">News.mp3</a> Link is: News.mp3 Last Updated:Fri Jun 14, 2020 05:20:13 pm Ever time the audio file is replaces it shows the last updated. I assume I can't but I'm getting desperate and figured I'd ask. Thank you Kim Link to comment Share on other sites More sharing options...
Ingolme Posted June 17, 2020 Report Share Posted June 17, 2020 document.lastModified can only show information about the current page. As I mentioned in another topic, you can use PHP's filemtime() function to get the modified date of a file on the server. 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