JS-Syntax und Browserweiche
Daniel
- javascript
Hallo und Danke fürs lesen,
die folgende Funkion führt grundsätzlich zur Version für die kleinere Auflösung was mich etwas verwundert, vielleicht überseh ich da was?:
function getBrowser() {
var agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns4 = (this.ns && (this.major >= 4));
this.ie = (agent.indexOf("msie") != -1);
this.ie4 = (this.ie && (this.major >= 4));
this.op3 = (agent.indexOf("opera") != -1);
this.win = (agent.indexOf("win")!=-1);
this.mac = (agent.indexOf("mac")!=-1);
this.unix = (agent.indexOf("x11")!=-1);
}
var bwr = new getBrowser();
if (bwr.ie4 && (screen.height >= 768)) document.location.href = "1020.html" ;
if (bwr.ie4 && (screen.height <= 768)) document.location.href = "800.html" ;
usw.
greetz
Daniel