CSS Redirect

They have: 22 posts

Joined: Sep 2000

Hello friends,
I've been searching the net now for the past 2 hours to look for a redirect scripts that would detect what version of IE and what version of NS the user has. I want this because I want different CSS files to load depending on the browser. I have found a couple of CSS redirect but the are only for Browser type (NS and IE) and not browser versions.

This is kind of an emergency, the site is being launched today.

Luc Deault

----------------------------------
If the minimum wasn't acceptable it wouldn't be called the minimum
-----------------------------------

Brian Farkas's picture

They have: 1,015 posts

Joined: Apr 1999

You might take a look at cgi-resources.com or hotscripts.com ... I know they have a few scripts that allow you to do redirection.

Good luck!

They have: 488 posts

Joined: Feb 2000

Since it's for detecting your visitor's browser(client-side)
then I would suggest using Javascript.

Here's the code:

<script LANGUAGE="JavaScript">= 4) ver = "nn4";
else if (bName == "Netscape" && bVer >= 3) ver = "nn3";
else if (bName == "Netscape" && bVer == 2) ver = "nn2";
else if (bName.indexOf('Microsoft') >= 0 && bVer >= 4) ver = "ie4";
else if (bName.indexOf('Microsoft') >= 0 && bVer >= 2) ver = "ie3";
else ver = "xx"
if (ver == "nn3" || ver == "nn4") self.location.replace('NN.html');
else if (ver == "nn2") self.location.href = 'N2.html';
else if (ver == "ie4") self.location.replace('IE4.html');
else if (ver == "ie3") self.location.href = 'IE3.html';
else if (ver == "xx") self.location.href = 'XX.html';//--></script>

Modify the code to suit your needs.

They have: 383 posts

Joined: Sep 2000

Here's the one I use. It’s already customized for CSS.

&lt;script language="javascript"&gt;

//tmtC_cssOnBrowser
tmt_css_NN = "ns.css";
tmt_css_IE = "ie.css";
if(document.layers){
   document.write("<link rel='stylesheet' href='" + tmt_css_NN + "' type='text/css'>");
}
if(document.all){
   document.write("<link rel='stylesheet' href='" + tmt_css_IE + "' type='text/css'>");
}//tmtC_cssOnBrowserEnd

&lt;/script&gt;
'

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I've never seen a CSS Redirect. Was it actually CSS that redirecting? (I don't think CSS can do that) Post the code if it was. Smiling

merlin's picture

They have: 410 posts

Joined: Oct 1999

i think it's meant to be a 'redirect to CSS', depending on i.e. browser, screen-resolution and such.
the redirect itself is done by javascript.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

ahh, now that I have seen Wink

They have: 22 posts

Joined: Sep 2000

Thanks all,

I got this now

<script LANGUAGE="JavaScript">
3 )) {
document.write(""); }
else if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >3 )) {
document.write(""); }
else {
document.write(""); }
// -->
</script>

This script is perfect for what I want it to do. The only problem with it is that IE 3.X and NS 3.X don't recognize the ("

Does anyone know a solution?

Luc Deault

----------------------------------
If the minimum wasn't acceptable it wouldn't be called the minimum
-----------------------------------

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.