Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
JavaScript code detects IE 10 as supported version instead of as out of date

The code below generates alert "Your browser is supported" even if the version is IE 10. It works perfectly with browsers such as IE 9, 8 and 7. I need to ensure only version IE 11 is allowed. Is there really anything wrong with the code?

<script type="text/javascript">
    jQuery(document).ready(function($){
    // true on IE11
    // false on Edge and other IEs/browsers.        filters.hide();
    // Allow only IE 11 and other browsers like Chrome, Safar, firefox so on,
    // but never allow lower versions of IE starting IE 10.
    var div = document.createElement("div");
    div.innerHTML = "<!--[if lt IE 11]><i></i><![endif]-->";
    var isIeLessThan11 = (div.getElementsByTagName("i").length == 1);
    if (isIeLessThan11) {
      alert("Your web browser is out of date. Please complete this form using an approved browser, such as Edge, Chrome, Safari, or Firefox.");
    } else {
      alert("Your browser is supported");
    }
  });
</script>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

According to wikipedia, conditional comments are not supported in IE10 and above. https://en.m.wikipedia.org/wiki/Conditional_comment

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda