console.log has been a wonderful functionality in firebug/firefox. Sadly, there is no such feature in IE(i personally don’t like debugger). A simple logger for IE is implemented to make console.log works under IE

Snapshot:
console.log for IE

How to use:
include:

<link href="css/ctp.log.css" rel="stylesheet" type="text/css"/>
<!-- JSON.stringify is used for stringify object. Remove if don't need -->
<script language = "javascript" src="js/json2.js"></script>
<script language = "javascript" src="js/ctp.log.js">

use:

//use it as console.log in Firefox
<script>
for(var x =0; x<10; x++){
//logging before UI is rendered
console.log({"value":x, "time":new Date()});
}
</script>

Download:
from Sourceforge

Advertisements