How can I use console logging in Internet Explorer?

You can access IE8 script console by launching the “Developer Tools” (F12). Click the “Script” tab, then click “Console” on the right.

From within your JavaScript code, you can do any of the following:

<script type="text/javascript">
    console.log('some msg');
    console.info('information');
    console.warn('some warning');
    console.error('some error');
    console.assert(false, 'YOU FAIL');
</script>

Also, you can clear the Console by calling console.clear().

NOTE: It appears you must launch the Developer Tools first then refresh your page for this to work.

Leave a Comment