• Log in or sign up for an account here: https://www.sythe.org/login

Block IE 6 on webbsite?

Cheeter

Grand Master

Cheetah
Retired Global Moderator
Joined
Jun 5, 2005
Sythe Gold
41
Messages
3,861
Location
Sweden
Extreme Homosex
Homosex
Any one got a script that blocks IE 6 users from entering my website?
I need this because I'm going to save my images in Transparent .PNG wich IE 6 don't support. Luckily They implemented it in IE 7 so I don't need to block tha.
 
Isn't there CSS that allows you to switch out the image if they have IE6? I dont remember the exact code :s
 
Extreme Homosex
Homosex
Isn't there CSS that allows you to switch out the image if they have IE6? I dont remember the exact code :s

Yes but I'm using background images wich it dosen't support e.t.c.
 
Disallowing IE users from entering your website is a bad thing to do as there are a lot of IE users.

Use this code to fix the PNG background bug, I took this code from the microsoft's website (I had the same with my own website):
/*
Correctly handle PNG transparency in Win IE 5.5 & 6.
Based originally on code from from http://homepage.ntlworld.com/bobosola.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) {
for(var i=0; i<document.images.length; i++) {
var img = document.images;
var imgName = img.src.toUpperCase();
if (imgName.indexOf(".PNG") > 0) {
var width = img.width;
var height = img.height;
var sizingMethod = (img.className.toLowerCase().indexOf("scale") >= 0)? "scale" : "image";
img.runtimeStyle.filter = "progid: DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src.replace('%23', '%2523').replace("'", "%27") + "', sizingMethod='" + sizingMethod + "')";
img.src = "/images/blank.gif";
img.width = width;
img.height = height;
}
}
}
 
Uh, read the whole thread; that's been posted already.
 
Code:
<script type="text/javascript">
<!--
var navname = Navigator.AppName

If (navname == Microsoft Internet Explorer)
{
 document.location('PAGE TO BE TRANSFERRED TO')
}
</script>
 
Runescape Gamblingrunescape gambling
Back
Top