/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var request = false;
// Request senden
function generateDesktop() {
document.getElementById('LoaderContent').innerHTML = 'Loading Desktop...';
// Request erzeugen
if (window.XMLHttpRequest) {
request = new XMLHttpRequest(); // Mozilla, Safari, Opera
} else if (window.ActiveXObject) {
try {
request = new ActiveXObject('Msxml2.XMLHTTP'); // IE 5
} catch (e) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP'); // IE 6
} catch (e) {}
}
}
// überprüfen, ob Request erzeugt wurde
if (!request) {
alert('Kann keine XMLHTTP-Instanz erzeugen');
return false;
} else {
//document.getElementById('desktop').innerHTML = '<img class=\"ohne\" src=\"bilder/loading.gif\">Öffnen...';
// Request öffnen
request.open('post', 'system/kernel/includes/generateDesktop.php', true);
// Requestheader senden
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// Request senden
request.send();
// Request auswerten
request.onreadystatechange = generateDesktop2;
}
}
// Request auswerten
function generateDesktop2() {
switch (request.readyState) {
// wenn der readyState 4 und der request.status 200 ist, dann ist alles korrekt gelaufen
case 4:
if (request.status != 200) {
alert('ERROR!: '+request.status);
} else {
document.getElementById('LoadPage').style.display = 'none';
var content = request.responseText;
// den Inhalt des Requests in das <div> schreiben
document.getElementById('desktopiconframe').innerHTML = content;
}
break;
default:
break;
}
}