redirection according to the browser ????
3 seguidores
Hello people !
Is there anibody who knows how to redirect somebody in fonction of the version of the browser. Because when you use the chromeless window ByKlein, it deals only since IE 5.5.
So do you have an idea ? Thanks and see you later ! :)
Josh
see the code of this page (by microbians)
then by example:
if(is.ie) document.location="yoururl";
GAsp
thanks for your answer.... But i'm not sure to have understand... Which page you talked ? This one ? Page of forum ? And if it's the case, i haven't found the code...
Sorry, i'm confused :lol:
loopecio
Hi! Gasp..
the DREAMWEAVER has an especific function for this on the BEHAVIORS section: 'check browser'
the code that insert is:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
if (app.indexOf('Netscape') != -1) {
if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
} else if (app.indexOf('Microsoft') != -1) {
if (version >= IEvers || verStr.indexOf(IEvers) != -1)
{if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}
//-->
</script>
**with this:
<body onLoad="MM_checkBrowser(4.0,1,2,4.0,1,2,2,'index.html','error.html'); return document.MM_returnValue">
i hope that was useful for you, but i'm shure it's better to use the behavior if you have the Dreamweaver.
*/ good luck.
GAsp
Many Thanks !!!! I'll test it now !!!
Josh
a minimal code:
<code>
//from https://www.domestika.org code by microbians
isie = (navigator.userAgent.match(/msie/i)&&!navigator.userAgent.match(/opera/i))||0;
document.location = isie ? "url4ie.html" : "url4others.html";
</code>