Hier ist der Code, der die neuen Unterseiten (sehr langsam) lädt:
function changecontent(url) {
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/text; charset=iso-8859-1');
// See note below about this line
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() { setContents(http_request); };
http_request.open('GET', url, true);
http_request.send(null);
}
function setContents(http_request) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
document.getElementById('inhalt').innerHTML =http_request.responseText;
if (seite=="gallery") {
document.getElementById('inhalt').style.top="10"
document.getElementById('bilder').style.left="-200";
}
else { document.getElementById('inhalt').style.width="480px";}
} else {
alert('There was a problem with the request.');
}
}
// Weiche wegen unterschiedlicher Darstellung der Gallerie, die horizontal gescrollt wird
if(navigator.appVersion.indexOf("MSIE 5")>-1) {
if (seite=="gallery") { document.getElementByID('bilder').style.left="-50px"; document.getElementByID('bilder').style.width="1800px"; }
}
if(navigator.appVersion.indexOf("MSIE 6")>-1) {
if (seite=="gallery") { document.getElementByID('bilder').style.left="-50px"; document.getElementByID('bilder').style.width="1800px"; }
}
// Neue Unterseite vom Seitenanfang (Top) darstellen
setpos(0,"inhalt");
}