Roland
07-01-2002, 09:20 AM
I donīt understand anything? How did I do this, it works with N6 and IE 6, not testet with Opera. How can it be improved? My vison of this is that I write a page in very simple HTML and depending on browser type different CCS is used. Dontīt know much about javascript :-/
<script type="text/javascript">
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
if (browser_type=="Netscape"&&browser_version>=5){
document.write('<link rel="stylesheet" type="text/css" href="css/index.css">');}
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4){
document.write('<link rel="stylesheet" type="text/css" href="css/ie_index.css">');}
else if (browser_type=="Opera"&&browser_version>=5){
document.write('<link rel="stylesheet" type="text/css" href="css/opera_index.css">');}
else
window.location="http://ullvitorget.koping.se/~JTR/sorry.html"
</script>
<script type="text/javascript">
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
if (browser_type=="Netscape"&&browser_version>=5){
document.write('<link rel="stylesheet" type="text/css" href="css/index.css">');}
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4){
document.write('<link rel="stylesheet" type="text/css" href="css/ie_index.css">');}
else if (browser_type=="Opera"&&browser_version>=5){
document.write('<link rel="stylesheet" type="text/css" href="css/opera_index.css">');}
else
window.location="http://ullvitorget.koping.se/~JTR/sorry.html"
</script>