5
I have a website that should not run on any version of IE, when trying to open the url I want a background-image that I will mount by saying that my site is not supported on IE.
This is possible to do?
I put this solution in my code:
<script type="text/javascript">
function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
// Se for o IE, retorna a versão
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))
return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
else
// Se estiver usando outro navegador, retorna 0
return 0;
return false;
}
var IE = msieversion();
if (IE !== 0) {
document.body.style.backgroundImage = "url('http://i.stack.imgur.com/mTXDZ.jpg')";
// Fazer algo a mais aqui ...
} else {
// O usuário usa outro navegador
}
</script>
and it worked but not the way I wanted to see the image of how it looked:
I would like that only appears the background and nothing else wanted that as if my site ceases to exist in the
Why do you want to block IE? something that doesn’t work?
– Sergio
not only that it is horrible to work with this browser however you try you will never get 100% and I have no time to waste with it when it is a browser that less than 1% of the population ultiliza and my site and turned to games soon abuses effects and make it work in ie and a hell
– Felipe Henrique
Kirito, the code I posted worked on your case?
– stderr
friend I’ll test Aja and that I’m at work and I wrapped up in something else here
– Felipe Henrique
Man, it’s better to ride a bugger than not run around and make a mistake like that to your visitor’s face. Especially when the guy uses IE, let’s face it, whoever uses IE doesn’t have basic IT knowledge (won’t install another browser)... ie, -1 visitor/client for you.
– Diego Moreira
@Diegomoreira and friend makes sense and that as my site is aimed at the gamer public I do not think it is necessary to cultivate the exlorer because until then I publish target are players so it may be that there is one who uses the most I find it difficult
– Felipe Henrique
The reason it presents is an unfortunate amateurism.. the only one who loses is yourself. If you write concise code, including common sense in using ready-made scripts as jquery plugins, you will not have problems with any browser..
– Daniel Omine