Menu

#18 "Object doesn't support this action" JavaScript error in IE 11 when in IE 8 compatibility mode.

v1.0 (example)
closed-fixed
nobody
None
5
2015-05-13
2014-10-08
A.P.
No

Hello,

The attached bug.html file, when dropped into the root of the log4javascript 1.4.10 release, gives a JavaScript error like:

SCRIPT445: Object doesn't support this action
File: log4javascript_uncompressed.js, Line: 1880, Column: 4

in Internet Explorer 11 when the F12 Developer Tools are used to put it into IE 8 compatibility mode. (Sorry, haven't tried it using actual IE 8, but I assume it would be a problem there, too.)

This sounds similar to problems that others have encountered:
- https://github.com/emberjs/ember.js/issues/3970
- http://stackoverflow.com/a/6875494

Changing line 1880 of js/log4javascript_uncompressed.js to be:

if ('undefined' === typeof console[consoleMethodName].apply) {

instead did appear to fix it under IE 11 in IE 8 compatibility mode. Limited testing suggested it still worked fine in at least Chrome and Firefox.

1 Attachments

Discussion

  • A.P.

    A.P. - 2014-10-08

    A screenshot showing the error as reported by the IE 11 dev tools.

     
  • Vadorequest

    Vadorequest - 2015-05-13

    Same here, but you need to rather write the following to use the best possible way to display messages.

    try {
                    console[consoleMethodName].apply(console, formattedMessage);
                }catch(e){
                    console[consoleMethodName](formattedMessage);
                }
    
     
  • Tim Down

    Tim Down - 2015-05-13

    Thanks for this. I've made a fix and released a new version.

     
  • Tim Down

    Tim Down - 2015-05-13
    • status: unread --> closed-fixed
     
  • Vadorequest

    Vadorequest - 2015-05-13

    thanks for fixing this that fast!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.