I don’t even know if this is posible.
I’m using straight HTML. It’s really my only option. No PHP, No .Net, No Java, YES JAVASCRIPT.
I have URL, and I’m trying to display the last modified date.
I came across this code, but it displasy the file, not the last modified date. Is there something wrong with the code, or is there another way to do this using just HTML and JavaScript?
I’m not able to share the real URL here.
<body><p>
<script src="https://www.website.com/wiki_form.html?nodeid=1103951244" type="text/javascript">// <![CDATA[
function getLastMod(){
var myFrm = document.getElementById('myIframe');
var lastModif = new Date(myFrm.contentWindow.document.lastModified);
document.getElementById('LastModified').innerHTML = "Prices correct as at: " + lastModif.toLocaleString();
}
// ]]></script>
<span id="LastModified"></span></p>
<p><iframe id="myIframe" src="https://www.website.com/wiki_form.html?nodeid=1103951244" style="display: none;"></iframe></p></body>
Thanks!
Lee
This solution is not possible with just HTML (HTML is static), and if you’re doing any interaction with files using JavaScript you’ll need to be hosted on a web-server. If that’s the case, you certainly have a reason to use PHP.