In IE11, How to use console.log?

后端 未结 2 2007
灰色年华
灰色年华 2021-01-17 09:53

Try to use console.log() But it\'s always printting undefined.

Try to use the solutions like Console.log IE9 issue it does not work as well

2条回答
  •  太阳男子
    2021-01-17 10:41

    Even though it's an old question, yet still giving me headache recently when working with IE11.

    Simple reason: console object is not initiated unless devtools (i.e. pressing F12 in IE11) is opened.

    So a workaround could be, open devtools before loading console.log().

    In my case, console.log is loaded when my page is ready, so I open devtools and refresh the page to view my log.

提交回复
热议问题