1

I am using asynchronous javascript functions on my website, which are not supported by Internet Explorer 11 or lower. Therefore, I want to show a warning to IE users. To achieve this, I used the following code:

<!--[if lte IE 11]> <style type="text/css"> 
#browserWarning { display:; }
#frame { display: block; }
</style> <![endif]-->

<div id="browserWarning">
    <h1>Internet Explorer is not supported!</h1>
    Unfortunately, Internet Explorer does not support asynchronous javascript functions. Therefore, this tool can only be used with current versions of Chrome (>= 58), Firefox (>=52), Opera (>=45) and Edge (>=15). Sorry!
</div>

However, nothing happens when I open the page with internet explorer 11. I have #browserWarning set to display:none in my stylesheet. Can someone tell me what I'm doing wrong?

Gasp0de
  • 1,199
  • 2
  • 12
  • 30
  • Keep in mind that it's not just IE that doesn't support async functions. There are a lot of browsers out there. How would your site respond to someone using a PSP to browse the internet? Or their smart TV? Or old brick mobile phone? You should *always* use feature detection to determine if the visitor's browser supports what you're trying to do. – Niet the Dark Absol Jul 21 '17 at 12:44
  • I'm sorry, this has already been answered. Conditional comments do not work in Internet Explorer 10 or 11 as explained here: [https://stackoverflow.com/questions/27470022/if-conditional-statement-not-working-with-ie-11](https://stackoverflow.com/questions/27470022/if-conditional-statement-not-working-with-ie-11) – Gasp0de Jul 21 '17 at 12:38

0 Answers0