Jump to content

How to prevent ie users from accessing site?


612wharfavenue

Recommended Posts

So ive just started with my site but im already at a point where ive tested the basic setup and ie8 is failing horribly at rendering it. Its very simple, but its mostly media oriented and the slider im using which was professionally made so theres not anything i can do to make it work better, so the only choice i have is to block ie users and leave a msg telling them to use another browser. Tried googling for it but couldnt find anything like it, anyone have links or advice on how to do this?

Link to comment
Share on other sites

So ive just started with my site but im already at a point where ive tested the basic setup and ie8 is failing horribly at rendering it. Its very simple, but its mostly media oriented and the slider im using which was professionally made so theres not anything i can do to make it work better, so the only choice i have is to block ie users and leave a msg telling them to use another browser. Tried googling for it but couldnt find anything like it, anyone have links or advice on how to do this?
aside from using the conditionals, I would encourage you to actually figure out why your page doesn't render. IE8 is not that bad, and usually the issues come down to developer error/bad practices. if you were to provide a link and cite some of your issues, I'm pretty confident there is a cross-browser solution that would work well in almost all versions of IE, save IE6. The most common bad practice is not using a DTD and have invalid markup, both of which are simple to pinpoint and fix.
Link to comment
Share on other sites

He pointed at you should use IE css for not showing nothing. Here is a javascript snippet,but it into HTML head!

<script type="text/javascript">var BrowserDetect = {init: function () {  this.browser = this.searchString(this.dataBrowser) || "";  this.version = this.searchVersion(navigator.userAgent)   || this.searchVersion(navigator.appVersion)   || "";  this.OS = this.searchString(this.dataOS) || "";},searchString: function (data) {  for (var i=0;i<data.length;i++) {   var dataString = data[i].string;   var dataProp = data[i].prop;   this.versionSearchString = data[i].versionSearch || data[i].identity;   if (dataString) {	if (dataString.indexOf(data[i].subString) != -1)	 return data[i].identity;   }   else if (dataProp)	return data[i].identity;  }},searchVersion: function (dataString) {  var index = dataString.indexOf(this.versionSearchString);  if (index == -1) return;  return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser: [  {   string: navigator.userAgent,   subString: "Chrome",   identity: "Chrome"  },  {  string: navigator.userAgent,   subString: "OmniWeb",   versionSearch: "OmniWeb/",   identity: "OmniWeb"  },  {   string: navigator.vendor,   subString: "Apple",   identity: "Safari",   versionSearch: "Version"  },  {   prop: window.opera,   identity: "Opera"  },  {   string: navigator.vendor,   subString: "iCab",   identity: "iCab"  },  {   string: navigator.vendor,   subString: "KDE",   identity: "Konqueror"  },  {   string: navigator.userAgent,   subString: "Firefox",   identity: "Firefox"  },  {   string: navigator.vendor,   subString: "Camino",   identity: "Camino"  },  {  // for newer Netscapes (6+)   string: navigator.userAgent,   subString: "Netscape",   identity: "Netscape"  },  {   string: navigator.userAgent,   subString: "MSIE",   identity: "Explorer",   versionSearch: "MSIE"  },  {   string: navigator.userAgent,   subString: "Gecko",   identity: "Mozilla",   versionSearch: "rv"  },  {   string: navigator.userAgent,   subString: "Mozilla",   identity: "Netscape",   versionSearch: "Mozilla"  }],dataOS : [  {   string: navigator.platform,   subString: "Win",   identity: "Windows"  },  {   string: navigator.platform,   subString: "Mac",   identity: "Mac"  },  {   string: navigator.userAgent,   subString: "iPhone",   identity: "iPhone/iPod"  },  {   string: navigator.platform,   subString: "Linux",   identity: "Linux"  }]};BrowserDetect.init();var doWeSupport=false;if (BrowserDetect.browser == "Safari" && (BrowserDetect.version=="" || BrowserDetect.version>=3)) doWeSupport=true;if (BrowserDetect.browser == "Firefox" && (BrowserDetect.version=="" || BrowserDetect.version>=3)) doWeSupport=true;if (BrowserDetect.browser == "Mozilla" && (BrowserDetect.version=="" || BrowserDetect.version>=3)) doWeSupport=true;if (BrowserDetect.browser == "Opera" && (BrowserDetect.version=="" || BrowserDetect.version>=9)) doWeSupport=true;if (BrowserDetect.browser == "Explorer" && (BrowserDetect.version>=9)) doWeSupport=true;if (BrowserDetect.browser == "Chrome") doWeSupport=true;if (!doWeSupport) top.location='nobrowser.html';</script>

So if client has IE version lower than 9,then he gets redirected to nobrowser.html Make a HTML called "nobrowser.html" with small CSS usage to inform clients that they have outdated browser.

Link to comment
Share on other sites

Im using this slider on my page, and it causes the rest of the animations to stagger in ie8, havent tried it in the other ies. It seems to stagger a bit too by itself. http://pixelentity.c...mponents/estro/
What exactly is the issue? I didn't see any difference between FF and IE, except that IE ran a little bit slower. There isn't anything you can do about that, though, because IE's JavaScript engine isn't as good.
um ok, what is ie.css? that doesnt tell me anything.
As Genert pointed out, it is illustrating how to use IE conditional comments to load an IE only CSS style sheet. You would create a div with the message you wish to display to IE users. In your regular CSS file, you set it's display to none so that IE 9 and up and non-IE browsers do not display it. Then you use the conditional comments as eTianbun showed to set the display to block. Except instead of targeting all IE browsers, you target version 8 and lower:<!--[if lte IE 8]><style type='text/css'>#ie_message { display: block; }</style><![end if]-->
Here is a javascript snippet,but it into HTML head! <<code>> So if client has IE version lower than 9,then he gets redirected to nobrowser.html Make a HTML called "nobrowser.html" with small CSS usage to inform clients that they have outdated browser.
That's a bit excessive for OP's intentions. Also, OP stated that the browser should not redirect:
just to clarify i want to show a graphic or something that says "if u want to view this site please use one of the following browsers" with links to each one, i dont want to ban them or redirect them.
Link to comment
Share on other sites

browser sniffing this day in age is pretty much obsolete, save for checking for tablets/mobile devices. Enough browsers are now standards compliant given a DTD and valid markup. The emphasis should be on developing cross-browser, standards compliant web sites that are accessible to everyone. For every problem, there is a solution. You just have to look for it, and maybe a try a little harder on your end. In this case, we are taking about the JS engine, not necessarily the DOM rendering engine. A message stating that performance may be compromised in certain browsers may be sufficient.

Link to comment
Share on other sites

The emphasis should be on developing cross-browser, standards compliant web sites that are accessible to everyone.  For every problem, there is a solution.  You just have to look for it, and maybe a try a little harder on your end. In this case, we are taking about the JS engine, not necessarily the DOM rendering engine.  A message stating that performance may be compromised in certain browsers may be sufficient.
Were talking the difference between 30fps and 10fps here. For a media-only site thats pretty much like saying "certain users watch your movie with smudged glasses, you should remake your movie so that its visible through the smudges". Or better yet "i choose to move around in a wheelchair because im lazy, please build a large yellow ramp to your front door".
Link to comment
Share on other sites

Internet Explorer 8 is perfectly standard compliant. I hardly even had trouble with Internet Explorer 7. The only browser you really should ignore is Internet Explorer 6. If your site isn't looking right in Internet Explorer these days, it's most likely not the browser's fault.

Link to comment
Share on other sites

Were talking the difference between 30fps and 10fps here. For a media-only site thats pretty much like saying "certain users watch your movie with smudged glasses, you should remake your movie so that its visible through the smudges". Or better yet "i choose to move around in a wheelchair because im lazy, please build a large yellow ramp to your front door".
Well, if you don't want to try, or just be sarcastic at advice offered to you on a performance related question that you started, then that's your choice. You seem to be hedging a lot of bets on this "professionally" developed code that is powering your site. What is it? Who wrote it? Why not share a link to it or your site so people can analyze it? Professional is just an adjective. Just because someone of a greater skill set then yourself may have written it, doesn't mean it's professional. You don't see jQuery bailing on IE just because it can be difficult to work with. Lot's of developers here have fair amounts of success with IE these days, just by following some good practices and using/writing well written code.
Link to comment
Share on other sites

funny, I was thinking the same thing. anyway, were here to help. I was just asking questions. You can take it anyway you want, which apparently is defensively. fwiw, I was looking online to see if there were any other issues with that plugin and IE, but wasn't having any luck. maybe if you had a link to your page we could keep helping, if that's not too much trouble for you. Maybe there is a conflict or something else you/we aren't seeing/thinking of since we aren't viewing your issue in context, like I was asking before, but you only choose to be snippy.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...