bobthabuilda bobthabuilda - 1 year ago 122
Javascript Question

How can I use console logging in Internet Explorer?

Is there a console logger for IE? I'm trying to log a bunch of tests/assertions to the console but I can't do this in IE.

Answer Source

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');'information');
    console.warn('some warning');
    console.error('some error');
    console.assert(false, 'YOU FAIL');

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download