Quote Originally Posted by rnd me View Post
Mozilla describes it best:
I think that quote dates back to around the time IE8 was released. It was true then but now that all modern browsers do support use strict it is no longer true when you ignore long obsolete browsers such as IE9 and earlier.

In practice the only browser that doesn't support use strict (and so still requires the quotes around the command) is IE8 as all the other browsers that don't support it are effectively dead.

I have been using "use strict" in all my new JavaScript code since 2011 and have never had a situation where the code didn't work across all popular browsers (including IE6). If you write your JavaScript properly in accordance with the current standard then the code will work the same regardless of whether the browser supports strict or not. Basically the use strict command provides some additional error checking when you run your initial tests in a modern browser.

As the next JavaScript version which is dependent on strict mode is expected to become the latest standard before the end of the year it is going to be interesting to see how browsers cope with all the new commands.

What we really need at this time given that Microsoft has declared IE8 to be unsupported is for someone to find and exploit one of the many security holes that browser almost certainly contains so as to force those who insist on using a dead browser to abandon it and use a modern browser instead (IE11 if they want to stick with Microsoft - although those using a dead operating system would need to install a VM to run it - easier to switch to Chrome).

There's an easy way to get IE8 and earlier to ignore the JavaScript and display the page as if JavaScript is not available since in fact JavaScript is not available in IE8 and earlier - Microsoft added support for JavaScript in IE9. All you need to do is to use the correct MIME type for your JavaScript and antiquated versions of IE that only recognise an antiquated JavaScript MIME type will then ignore the script completely.

<script type="application/javascript">