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: | <script language="javascript" type="text/javascript">
var xmlHttpObject = false;
// Überprüfen ob XMLHttpRequest-Klasse vorhanden und erzeugen von Objekte für IE7, Firefox, etc.
if (typeof XMLHttpRequest != 'undefined')
{
xmlHttpObject = new XMLHttpRequest();
}
// Wenn im oberen Block noch kein Objekt erzeugt, dann versuche XMLHTTP-Objekt zu erzeugen
// Notwendig für IE6 oder IE5
if (!xmlHttpObject)
{
try
{
xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
xmlHttpObject = null;
}
}
}
if (xmlHttpObject) {
xmlHttpObject.open('GET', 'http://xproshowcasex.api.channel.livestream.com/2.0/livestatus.json?callback=livestatus', true);
xmlHttpObject.onreadystatechange = function () {
if (xmlHttpObject.readyState == 4) {
alert(xmlHttpObject.responseText);
if (xmlHttpObject.responseText.search("true") !="-1"){
alert("online");
}
else{
alert("offline");
}
}
};
xmlHttpObject.send(null);
}
</script> |