Jump to content


- - - - -

Block IE?


  • Please log in to reply
2 replies to this topic

#1 Temp2

Temp2

    Novice

  • Members
  • PipPip
  • 12 posts
  • Real Name:Fukn Lolcna
  • IPB Version:v2.3.x

Posted 25 March 2011 - 10:53 PM

Hey there, I am searching a way from blocking IE users to see my site.

Reason is most of my jQueries and Javascripts are iframed, And IE does not support it.

Obviously, If i'm asking it's cause I don't know how to block it. I got no idea.

Something that gets redirected to a site or just shows a text or a html page saying that he has to download something else than IE.

For the IPB Part, Ill simply add the code to the board header.

#2 Temp2

Temp2

    Novice

  • Members
  • PipPip
  • 12 posts
  • Real Name:Fukn Lolcna
  • IPB Version:v2.3.x

Posted 26 March 2011 - 12:06 AM

Big nevermind.

I found out some few tricks.

var IE7 = (navigator.userAgent.indexOf("MSIE 7")>=0) ? true : false;
if(IE7){

	$(function(){
		
		$("<div>")
			.css({
				'position': 'absolute',
				'top': '0px',
				'left': '0px',
				backgroundColor: 'black',
				'opacity': '0.75',
				'width': '100%',
				'height': $(window).height(),
				zIndex: 5000
			})
			.appendTo("body");
			
		$("<div><p><br /><strong>Sorry! This page doesn't support Internet Explorer.</strong><br /><br />Download: <a href='http://mozilla.com'>Firefox</a> or <a href='Download: <br /><a href='http://www.google.com/chrome?hl=en'>Google Chrome</a>.</p>")
			.css({
				backgroundColor: 'white',
				'top': '50%',
				'left': '50%',
				marginLeft: -210,
				marginTop: -100,
				width: 500,
				paddingRight: 10,
				height: 200,
				'position': 'absolute',
				zIndex: 6000
			})
			.appendTo("body");
	});		
}

Using this code
var IE7 = (navigator.userAgent.indexOf("MSIE 7")>=0) ? true : false;
if(IE7){

You can block every IE Versions by changing the number.

var IE8 = (navigator.userAgent.indexOf("MSIE 8")>=0) ? true : false;
if(IE8){


#3 najaru

najaru

    Programmer

  • Modders
  • PipPipPipPipPipPip
  • 395 posts
  • Real Name:Andrea
  • IPB Version:v3.0.x
Contributor

Posted 27 March 2011 - 07:16 AM

maybe is better to send IE to ip.mobile with Manage User Agent Mapping
Posted Image
If you need custom modification on Skin or IP.Content, PM me

Use +1Rep Posted Image Plese Posted Image





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users