Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The reason your code doesn't work in newer IE versions is because you're using obsolete (very <em>very</em> obsolete) code. You need to update to modern web standards if you expect modern browsers (including IE10) to work.</p> <p>Two issues are obvious immediately:</p> <ol> <li><p><code>document.all</code> has been deprecated for years; you shouldn't be using it -- it is non-standard and only still exists to allow backward-compatibility with ancient versions of IE (eg IE5). Modern IE versions won't like it, and it <em>definitely</em> doesn't work on browsers other an IE.</p> <p>In most cases, if you're trying to reference an element by ID (as in this case), you should use <code>document.getElementById()</code> instead.</p> <p>Further info from <a href="https://developer.mozilla.org/en-US/docs/Using_Web_Standards_in_your_Web_Pages/Using_the_W3C_DOM" rel="nofollow noreferrer">Mozilla Developer Network</a>.</p></li> <li><p><code>new ActiveXObject("MSXML2.DOMDocument.3.0")</code> is also non-standard and deprecated, and also shouldn't be used in modern browsers. Again, it is IE-specific, and was replaced from IE7 onward with the web standards alternative.</p> <p>You should replace it with <code>document.implementation.createHTMLDocument();</code>. See also the anwsers <a href="https://stackoverflow.com/questions/8227612/how-to-create-document-objects-with-javascript">here</a>.</p> <p>If you need to support IE6 or earlier then you can detect whether the browser supports the standard syntax and provide a fall back to the old ActiveX control only for old IE versions.</p></li> </ol> <p>Given that the tiny bit of code you've shown us is using two obvious and well known features that are so badly out-of-date, I would expect to see more problems of a similar nature if we were to see more of your code. Because of this, I would recommend posting some of your code on SO's sister site <a href="https://codereview.stackexchange.com/">https://codereview.stackexchange.com/</a> to get some additional feedback on how you can improve it.</p> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload