peri: Abfrage mit ns 7

Beitrag lesen

hi, ich bastle auch gerade an sowas ,
schaus dir mal an, is aber noch in der mache.

var system= (navigator.appVersion.indexOf("Mac")==-1)?"PC":"MAC";
var browser=(navigator.appName.indexOf("Microsoft")==-1)?"NS":"IE";
var systembrowser=system+ browser;

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ns7=document.getElementById&&!document.all

var skinpath='skin/{skinname}/';
alert (systembrowser);

switch (systembrowser)
 {
  case "PCIE":
  document.write("<link rel=stylesheet type='text/css' href='"+skinpath+"ie_pc.css'>");
  break;

case "PCNS":
  // Browserbedingt umleiten
  if (ns4){
  location.href="ns4.htm";
  }
  if (ns6){
  location.href="ns6.htm";
  }
  if (ns7){
  location.href="ns7.htm";
  }

document.write("<link rel=stylesheet type='text/css' href='"+skinpath+"ns_pc.css'>");
  break;

case "MACIE":
  document.write("<link rel=stylesheet type='text/css' href='"+skinpath+"ie_mac.css'>");
  break;

case "MACNS":
  // Browserbedingt umleiten
  if (ns4){
  location.href="ns4.htm";
  }
  if (ns6){
  location.href="ns6.htm";
  }
  if (ns7){
  location.href="ns7.htm";
  }
   document.write("<link rel=stylesheet type='text/css' href='"+skinpath+"ns_mac.css'>");
  break;

default:
  document.write("<link rel=stylesheet type='text/css' href='"+skinpath+"ie_pc.css'>");
  break;
}