PDA

View Full Version : My favourite programming function in the entire world



HotelUser
16-06-2010, 01:39 AM
function antiIE() {
echo '<script>
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
{
alert("Microsoft imposes restrictions on Internet Explore which make it impossible to render this page. Please download a better browser.");
window.location = "http://www.google.com/chrome";
}
</script>';
}



Why don't websites seriously implement this?

Kyle
16-06-2010, 01:42 AM
what does it do

Blinger$
16-06-2010, 01:55 AM
pretty much gets the name of the internet browser and says some ******** which is spelt wrong (way to go, genius!) and then redirects you to google ;\

Kyle
16-06-2010, 02:00 AM
Wow Dats Mazin

Blinger$
16-06-2010, 02:03 AM
Wow Dats Mazin
it sure as hell is.. i mean, c'mon! what other function can be THAT awesome?

its almost as good as the


<script>
while(1=1){
alert("lulz");
}
</script>

HotelUser
16-06-2010, 02:06 AM
I didn't write it, I found it. However I'm going to use it because I even get jquery errors with Internet explorer. Internet explorer even changes the quotes and capitalization of webpage's source.

Blinger$
16-06-2010, 02:06 AM
I didn't write it, I found it. However I'm going to use it because I even get jquery errors with Internet explorer. Internet explorer even changes the quotes and capitalization of webpage's source.
if i ever got a message like that on a site i WANTED to visit, i'd sure as **** never go back.

HotelUser
16-06-2010, 02:08 AM
if i ever got a message like that on a site i WANTED to visit, i'd sure as **** never go back.

You'd have to be quite computer illiterate to be using Internet Explorer in the first place.

Blinger$
16-06-2010, 02:11 AM
You'd have to be quite computer illiterate to be using Internet Explorer in the first place.
why? its newer browsers are good.

HotelUser
16-06-2010, 02:15 AM
why? its newer browsers are good.

No they're not. IE completely fails with the simplest of tasks, such as aligning margins with CSS, or setting up borders. When you try to use jquery let alone javascript by itself everything just sucks, and it renders pagest stupidly slow.

I've fixed your previous source example for you:


while(1==1)
alert('lulz');

Blinger$
16-06-2010, 02:17 AM
No they're not. IE completely fails with the simplest of tasks, such as aligning margins with CSS, or setting up borders. When you try to use jquery let alone javascript by itself everything just sucks, and it renders pagest stupidly slow.

I've fixed your previous source example for you:


while(1==1)
alert('lulz');

the example i provided would work fine..

http://www.tizag.com/javascriptT/javascriptwhile.php :rolleyes:

HotelUser
16-06-2010, 02:18 AM
You had one equal sign, which wouldn't properly evaluate the expression properly.

Recursion
16-06-2010, 06:55 AM
No they're not. IE completely fails with the simplest of tasks, such as aligning margins with CSS, or setting up borders. When you try to use jquery let alone javascript by itself everything just sucks, and it renders pagest stupidly slow.

I've fixed your previous source example for you:


while(1==1)
alert('lulz');


Go look at the IE9 preview. Whilst IE is the bane of a web designer's life (until IE9 is launched), they sure has hell need to accomodate for it, just remember the majority of the internet uses IE.

If I ever saw that code in the source of a site (even when I didn't use IE), I'd think what a **** head of a designer he was! (And to mods, im not referencing anyone here...)

Apolva
16-06-2010, 09:57 AM
My preferable of warning off IE users, while keeping their business (+ using stupid IE features against it =]):

<!--[if IE]>
<div style='background:#F00;font-weight:bold;border-bottom:2px solid #000;margin:-8px;color:#FFF;text-align:center;padding:5px;'>By using Internet Explorer, you are hindering the development of the web and putting yourself at risk - <a style='color:#FFF;' href='http://getfirefox.net/'>Get Firefox!</a></div>
<![endif]-->

Better example of your while loop:

while(true) alert('lulz');

Recursion
16-06-2010, 10:10 AM
There's no need to "warn" IE users, do you see major websites like Facebook, Digg, MySpace, the BBC, Wired, The NY Times etc warning them or even blocking them from their site, no!

Apolva
16-06-2010, 10:15 AM
There's no need to "warn" IE users, do you see major websites like Facebook, Digg, MySpace, the BBC, Wired, The NY Times etc warning them or even blocking them from their site, no!

Do you see the French and German government doing it? oh wait.

xxMATTGxx
16-06-2010, 10:31 AM
Do you see the French and German government doing it? oh wait.

It didn't last very long...

The Professor
16-06-2010, 10:51 AM
There's no need to "warn" IE users, do you see major websites like Facebook, Digg, MySpace, the BBC, Wired, The NY Times etc warning them or even blocking them from their site, no!

That's because their target audience (sans digg & wired) are quite possibly computer illiterate, don't know what a browser is and wouldn't bother learning just so they can use those websites. Digg and Wired should but its probably for the same reason; im sure there are some people who like using IE that use those sites and they don't want to alienate them.

HotelUser
19-06-2010, 03:22 PM
That's because their target audience (sans digg & wired) are quite possibly computer illiterate, don't know what a browser is and wouldn't bother learning just so they can use those websites. Digg and Wired should but its probably for the same reason; im sure there are some people who like using IE that use those sites and they don't want to alienate them.

Precisely. If I'm making a utility for a small group of people, I don't want to make two versions. I shouldn't have to code anything twice. If I was targeting a massive audience I would have no choice but to implement an atleast semi-compatible variant for use with Microsoft Internet Explorer failure.

Recursion
20-06-2010, 01:08 PM
Precisely. If I'm making a utility for a small group of people, I don't want to make two versions. I shouldn't have to code anything twice. If I was targeting a massive audience I would have no choice but to implement an atleast semi-compatible variant for use with Microsoft Internet Explorer failure.

No one said it was for a small group of people. You shouldn't just be a complete ass and stop IE users from viewing your site, it is the most used browser in the world :|

Moh
20-06-2010, 01:10 PM
print_r

Oh, the amount of times that's helped!

HotelUser
20-06-2010, 02:53 PM
No one said it was for a small group of people. You shouldn't just be a complete ass and stop IE users from viewing your site, it is the most used browser in the world :|

And it's the worst, undisputed.

Agnostic Bear
20-06-2010, 03:36 PM
And it's the worst, undisputed.

That's an opinion.

MrPinkPanther
20-06-2010, 03:50 PM
No one said it was for a small group of people. You shouldn't just be a complete ass and stop IE users from viewing your site, it is the most used browser in the world :|

Ignore them, people seem to think bashing Internet Explorer makes them look cool. It's bad but lets not exaggerate, its not that bad. It works in the vast majority of cases and Explorer 9 looks nice and this is coming from someone on a MacBook.

HotelUser
20-06-2010, 03:58 PM
That's an opinion.

Internet explorer:
- Can't speak Javascript (because most every page complains about a JS error when there's none)
- Hates CSS with a passion and lacks common features of css everyone else uses
- changes the capitalization and quotations within source
- renders horribly slow
- has a god awful caching system
- Doesn't let us use cross domain calls through frames!
- It doesn't know what security (http://www.associatedcontent.com/article/2102085/firefox_vs_internet_explorer_vs_safari.html?cat=15 ) is

It's not my opinion, it's a fact, and if you, a developer, who should have experienced having to tailor specific versions of your scripts to work on internet explorer, says otherwise, then I can't say you're much of a web developer, unless you know an incredibly good toolkit.

Oh, and just to prove my point, that Internet explorer is that uncooperative kid brother everyone hates:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head profile="http://dublincore.org/documents/dcq-html/">
<meta name="dcterms.created" content="2010-06-10T12:01:34Z" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="description" content="Breaking news, sport, TV, radio and a whole lot more. The BBC informs, educates and entertains - wherever you are, whatever your age." />
<meta name="keywords" content="BBC, bbc.co.uk, bbc.com, Search, British Broadcasting Corporation, BBC iPlayer, BBCi" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="robots" content="noodp" />
<link rel="apple-touch-icon" href="http://static.bbc.co.uk/homepage/img/iphone.png"/>
<title>BBC - Homepage</title>
<link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/main.css?3" media="screen,print" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie6.css?3" media="screen,print" />
<![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie7.css?3" media="screen,print" />
<![endif]--><!--[if IE 8]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie8.css?3" media="screen,print" />
<![endif]--><!--[if gt IE 8]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/gt-ie8.css?3" media="screen,print" />
<![endif]--> <link rel="schema.dcterms" href="http://purl.org/dc/terms/" /> <link rel="index" href="http://www.bbc.co.uk/a-z/" title="A to Z" /> <link rel="help" href="http://www.bbc.co.uk/help/" title="BBC Help" /> <link rel="copyright" href="http://www.bbc.co.uk/terms/" title="Terms of Use" /> <link rel="icon" href="http://www.bbc.co.uk/favicon.ico" type="image/x-icon" /> <meta name="viewport" content="width = 974" /> <link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/frameworks/barlesque/1.1.6/newnav/style/main.css" />
<link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/bbcdotcom/0.3.9/style/3pt_ads.css" />
<script type="text/javascript" src="http://node1.bbcimg.co.uk/glow/gloader.0.1.3.js"> gloader.use("glow", {map: "http://node1.bbcimg.co.uk/glow/glow/map.1.7.2.js"}); </script> <script type="text/javascript" src="http://static.bbc.co.uk/frameworks/barlesque/1.1.6/newnav/script/blq_core.js"></script>
<!--[if (IE 6)|(IE 7)]>


Not only did BBC have to use different CSS and javascript for Internet Explorer, they had to use different sheets for different VERSIONS of Internet Explorer.

Apolva
20-06-2010, 04:04 PM
That's an opinion.

It really isn't. Sure other browsers aren't perfect in every scenario, but the shear amount of made up IE standards amazes me, meaning a developer must cater for standard compliant browsers, and then IE. It also lags behinds all the other browsers in terms of evolution.

Pieman
20-06-2010, 04:05 PM
No one said it was for a small group of people. You shouldn't just be a complete ass and stop IE users from viewing your site, it is the most used browser in the world :|

Most used browser in the world?

http://www.w3schools.com/browsers/browsers_stats.asp

PatrickMS
20-06-2010, 04:45 PM
Well then you've lost over 60% of your users!

http://www.blogcdn.com/www.engadget.com/media/2010/01/2jan99uib3r1.jpg

That's not a thing you should be wanting! heck- you want as many as possible!

Recursion
20-06-2010, 05:13 PM
Most used browser in the world?

http://www.w3schools.com/browsers/browsers_stats.asp

Those statistics are for the W3Schools.com website alone, which, be realistic, only people interested in coding/technology are going to be going to, and those people are likely to be using a third party browser.



W3Schools is a website for people with an interest for web technologies. These people are more interested in using alternative browsers than the average user. The average user tends to use Internet Explorer, since it comes preinstalled with Windows. Most do not seek out other browsers.

These facts indicate that the browser figures above are not 100% realistic. Other web sites have statistics showing that Internet Explorer is used by at least 80% of the users.

Anyway, our data, collected from W3Schools' log-files, over a five year period, clearly shows the long and medium-term trends.

Laurensh1
20-06-2010, 06:07 PM
Firefox >>> Chrome.
Do you best to help.

Agnostic Bear
21-06-2010, 08:13 AM
Internet explorer:
- Can't speak Javascript (because most every page complains about a JS error when there's none)
- Hates CSS with a passion and lacks common features of css everyone else uses
- changes the capitalization and quotations within source
- renders horribly slow
- has a god awful caching system
- Doesn't let us use cross domain calls through frames!
- It doesn't know what security (http://www.associatedcontent.com/article/2102085/firefox_vs_internet_explorer_vs_safari.html?cat=15 ) is

It's not my opinion, it's a fact, and if you, a developer, who should have experienced having to tailor specific versions of your scripts to work on internet explorer, says otherwise, then I can't say you're much of a web developer, unless you know an incredibly good toolkit.

Oh, and just to prove my point, that Internet explorer is that uncooperative kid brother everyone hates:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head profile="http://dublincore.org/documents/dcq-html/">
<meta name="dcterms.created" content="2010-06-10T12:01:34Z" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="description" content="Breaking news, sport, TV, radio and a whole lot more. The BBC informs, educates and entertains - wherever you are, whatever your age." />
<meta name="keywords" content="BBC, bbc.co.uk, bbc.com, Search, British Broadcasting Corporation, BBC iPlayer, BBCi" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="robots" content="noodp" />
<link rel="apple-touch-icon" href="http://static.bbc.co.uk/homepage/img/iphone.png"/>
<title>BBC - Homepage</title>
<link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/main.css?3" media="screen,print" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie6.css?3" media="screen,print" />
<![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie7.css?3" media="screen,print" />
<![endif]--><!--[if IE 8]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/ie8.css?3" media="screen,print" />
<![endif]--><!--[if gt IE 8]><link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/homepage/css/bundles/international/gt-ie8.css?3" media="screen,print" />
<![endif]--> <link rel="schema.dcterms" href="http://purl.org/dc/terms/" /> <link rel="index" href="http://www.bbc.co.uk/a-z/" title="A to Z" /> <link rel="help" href="http://www.bbc.co.uk/help/" title="BBC Help" /> <link rel="copyright" href="http://www.bbc.co.uk/terms/" title="Terms of Use" /> <link rel="icon" href="http://www.bbc.co.uk/favicon.ico" type="image/x-icon" /> <meta name="viewport" content="width = 974" /> <link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/frameworks/barlesque/1.1.6/newnav/style/main.css" />
<link rel="stylesheet" type="text/css" href="http://static.bbc.co.uk/bbcdotcom/0.3.9/style/3pt_ads.css" />
<script type="text/javascript" src="http://node1.bbcimg.co.uk/glow/gloader.0.1.3.js"> gloader.use("glow", {map: "http://node1.bbcimg.co.uk/glow/glow/map.1.7.2.js"}); </script> <script type="text/javascript" src="http://static.bbc.co.uk/frameworks/barlesque/1.1.6/newnav/script/blq_core.js"></script>
<!--[if (IE 6)|(IE 7)]>


Not only did BBC have to use different CSS and javascript for Internet Explorer, they had to use different sheets for different VERSIONS of Internet Explorer.

It's still an opinion. There are no facts or figures that can change somebody's opinion on a matter.

MrPinkPanther
21-06-2010, 08:46 AM
A browser preference IS an opinion. From a coders perspective IE may be inferior but for the average end user there is little difference between Firefox and Internet Explorer, in fact Internet Explorer is probably the best option since it comes preinstalled.

Apolva
21-06-2010, 09:11 AM
OK, it's an opinion shared by an over-all majority.

No idea why you are defending such a terrible browser still.

GommeInc
21-06-2010, 10:16 AM
OK, it's an opinion shared by an over-all majority.

No idea why you are defending such a terrible browser still.
Because it works sufficiently and the dumb majority wouldn't know the difference? Remember, we're young and understand technology, a lot of people either don't care or do not know. :P

HotelUser
21-06-2010, 11:19 AM
It's still an opinion. There are no facts or figures that can change somebody's opinion on a matter.

If you're still staying this, Jewish Bear, then you've really discredited yourself in my eyes as a developer, because most web developers understand the limitations of Internet Explorer through experience, and it's a little concerning that you've never come across them.

Trinity
21-06-2010, 12:43 PM
If you're still staying this, Jewish Bear, then you've really discredited yourself in my eyes as a developer, because most web developers understand the limitations of Internet Explorer through experience, and it's a little concerning that you've never come across them.

From what I've seen (although I could be wrong) he isn't saying it's an awesome browser, he isn't saying that he hasn't come across any issues with it, he just pointed out that you were expressing an opinion, not a fact.
Maybe he does think that it's awesome, maybe he doesn't. He hasn't actually stated anything in the thread (unless I've missed it).

HotelUser
21-06-2010, 08:26 PM
From what I've seen (although I could be wrong) he isn't saying it's an awesome browser, he isn't saying that he hasn't come across any issues with it, he just pointed out that you were expressing an opinion, not a fact.
Maybe he does think that it's awesome, maybe he doesn't. He hasn't actually stated anything in the thread (unless I've missed it).

I will accept an opinion so long as it's backed up by reasonable points. In this case it's really not.

It's like how people say the Holocaust didn't happen, but then can't explain it and get mad when we facepalm at them!

Firehorse
21-06-2010, 10:01 PM
Nice rant about your troubles with IE. We all know that IE can be a bugger to code for, but most of us just find ways around things and get on with it, rather than complaining on a forum or blocking out more than half your potential web traffic. I personally use Internet Explorer; not because I have problems with other browsers, but because i've used it from the start and am very used to it. I agree things sometimes look a little different, but as someone who tends to browse more than code at the moment all the websites I ever visit display fine. Also for some reason IE8 seems more responsive than FireFox, less clunky, and opens itself faster on the first load.

HotelUser
21-06-2010, 10:42 PM
Futuristically I think there's going to be more pressure on Microsoft to bring raise Explorer's standards as to be more acceptable.


Nice rant about your troubles with IE. We all know that IE can be a bugger to code for, but most of us just find ways around things and get on with it, rather than complaining on a forum or blocking out more than half your potential web traffic. I personally use Internet Explorer; not because I have problems with other browsers, but because i've used it from the start and am very used to it. I agree things sometimes look a little different, but as someone who tends to browse more than code at the moment all the websites I ever visit display fine. Also for some reason IE8 seems more responsive than FireFox, less clunky, and opens itself faster on the first load.

Recursion
22-06-2010, 06:51 AM
Futuristically I think there's going to be more pressure on Microsoft to bring raise Explorer's standards as to be more acceptable.

as with IE9 you mean... as I was pointing you to earlier in the thread... :rolleyes:

MattFr
22-06-2010, 11:15 AM
Lol, complaining about Internet Explorer is completely pointless. It's the most used browser in the world, get over it and make your code work with it. God.

Recursion
22-06-2010, 03:47 PM
And actually, remember schools like to use IE because it's easy to centrally manage, if you don't code your site for IE too, then you immediately lose out on hundreds, possibly thousands of users.

triston220
24-06-2010, 09:43 PM
No one said it was for a small group of people. You shouldn't just be a complete ass and stop IE users from viewing your site, it is the most used browser in the world :|

Only because it comes with most versions of Windows.

Recursion
24-06-2010, 09:59 PM
Only because it comes with most versions of Windows.

That doesn't mean people should stop coding for it.

HotelUser
25-06-2010, 12:53 AM
That doesn't mean people should stop coding for it.

If big companies agreed to stop coding for it then we could phase it out.

Recursion
25-06-2010, 06:41 AM
If big companies agreed to stop coding for it then we could phase it out.

I dont want to move all of our school browsers over to something else, for the simple fact that Microsoft has done a damn awesome job at integrating it into Windows and making it easy to centrally manage through Group Policies, which IS NOT possible with something like FF or Chrome For e.g. If I want to change the proxy settings for a browser school-wide, I dont particularly want to have to download Firefox (or Chrome, FF is losing my faith), manually unpackage it, manually change all the settings and then manually repackage it into an MSI ready to deploy, it's just not worth the hassle when I could go into GPOs and edit a line in a nice GUI and not have to worry anymore.

triston220
25-06-2010, 06:55 AM
That doesn't mean people should stop coding for it.

Didn't say they should. :P

HotelUser
25-06-2010, 01:43 PM
If either of those browsers use thhe registry to save settings then this is not a problem. If they use XML then you could simply install Firefox on the computers to a shared directory?



I dont want to move all of our school browsers over to something else, for the simple fact that Microsoft has done a damn awesome job at integrating it into Windows and making it easy to centrally manage through Group Policies, which IS NOT possible with something like FF or Chrome For e.g. If I want to change the proxy settings for a browser school-wide, I dont particularly want to have to download Firefox (or Chrome, FF is losing my faith), manually unpackage it, manually change all the settings and then manually repackage it into an MSI ready to deploy, it's just not worth the hassle when I could go into GPOs and edit a line in a nice GUI and not have to worry anymore.

Want to hide these adverts? Register an account for free!