79431491

Date: 2025-02-11 22:48:25
Score: 0.5
Natty:
Report link

The accepted answer helps the OP in a specific case.
To answer a question defined in title and tags, that is to find a last modified date of a file by its URI using JavaScript, we can use an example from MDN:

function getHeaderTime() {
  console.log(this.getResponseHeader("Last-Modified")); // A valid GMTString date or null
}

const req = new XMLHttpRequest();
req.open(
  "HEAD", // use HEAD when you only need the headers
  "your-page.html",
);
req.onload = getHeaderTime;
req.send();

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest#get_last_modified_date

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: papo