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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| <script language="JavaScript" type="text/javascript">
function getXhr() {
var xhr = null;
//firefox
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}
//ie
else if (window.ActiveXObject) {
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
//non supporté
else {
alert("Fonction non supportée par le navigateur");
xhr = false;
}
return (xhr);
}
function maj(int note) {
var wesh = getXhr();
wesh.onreadystatechange = function() {
if (wesh.readyState == 4 && wesh.status == 200) {
var resultat = wesh.responseText;
document.getElementById('note').innerHTML=resultat;
}
};
wesh.open("GET","http://generationsfm.com/seb/note.php?note="+note,true);
wesh.send(null);
}
function getTrack()
{
var xhr = getXhr();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var resultat = xhr.responseText;
document.getElementById('div_track').innerHTML=resultat;
}
};
xhr.open("GET","http://generationsfm.com/seb/track.php",true);
xhr.send(null);
setTimeout("getTrack()", 5000);
}
getTrack();
</script> |
Partager