« Utilisateur:Maxim21/common.js » : différence entre les versions
m Derp, derp, derp |
mAucun résumé des modifications |
||
| Ligne 3 : | Ligne 3 : | ||
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) { | if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) { | ||
var a = xhr.responseXML; | var a = xhr.responseXML; | ||
var lastModif = new Date(a.getElementsByTagName('page')[0].getAttribute('touched')); | |||
alert(lastModif.getDate()); | |||
} | } | ||
}; | }; | ||
xhr.open('GET', 'http://nuvapedia.fr/api.php?action=query&format=xml&titles=Modèle:Accueil/Fiche&prop=info', true); | xhr.open('GET', 'http://nuvapedia.fr/api.php?action=query&format=xml&titles=Modèle:Accueil/Fiche&prop=info', true); | ||
xhr.send(null); | xhr.send(null); | ||
Version du 28 septembre 2014 à 19:07
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
var a = xhr.responseXML;
var lastModif = new Date(a.getElementsByTagName('page')[0].getAttribute('touched'));
alert(lastModif.getDate());
}
};
xhr.open('GET', 'http://nuvapedia.fr/api.php?action=query&format=xml&titles=Modèle:Accueil/Fiche&prop=info', true);
xhr.send(null);