Thread Ajax und Last-Modified (7 answers)
Opened by rosti at 2023-11-14 10:52

rosti
 2023-11-15 09:31
#195543 #195543
User since
2011-03-19
3150 articles
BenutzerIn
[Homepage]
user image
2023-11-14T11:48:06 GwenDragon
Ist das dein JS für XHR? Oder eine Lib?
Zeig doch mal deinen JS-Code zur Abfrage.


Code: (dl )
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();

View full thread Ajax und Last-Modified