2023-11-14T11:48:06 GwenDragonIst das dein JS für XHR? Oder eine Lib?
Zeig doch mal deinen JS-Code zur Abfrage.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// URLs Check Ergebnis
function chkres(){
let res = {};
res.url = this.URL; //getResponseHeader('x-url');
res.lastmod = this.getResponseHeader('Last-Modified');
res.status = this.status;
let table = document.getElementById('tbody');
let tr = document.createElement('tr');
res.color = this.status == 200 ? 'blue' : 'red';
tr.innerHTML = xr("<td style='color:@color@'>@status@</td> <td><a href='@url@'>@url@</a></td> <td>@lastmod@</td>", res);
table.appendChild(tr);
$('#chkres').tablesorter();
}
function chkurls(){
let urls = this.response.split("\n");
for(let i = 0; i < urls.length; i++){
let xhr = new XHR( chkres );
xhr.xhr.URL = urls[i];
xhr.put(urls[i]);
}
}
function list_urls(){
// Liste der URLs download
let ls = new XHR(chkurls);
ls.get("%url%?u=1");
}
list_urls();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
> const client = new XMLHttpRequest();
client.open("GET", "http://rolfrost.de/", true);
client.send();
client.onreadystatechange = () => {
if (client.readyState === client.HEADERS_RECEIVED) {
const httpLM = client.getResponseHeader("Last-Modified");
console.log(httpLM);
}
};
<. () => {
if (client.readyState === client.HEADERS_RECEIVED) {
const httpLM= client.getResponseHeader("Last-Modified");
console.log(httpLM);
}
}
VM42:7 Tue, 14 Nov 2023 09:03:16 GMT