Thursday, June 17, 2010

Logging in Javascript

Using Logging in Javascript
It's very usefull to have logging statement in your code .
console.log(); statement is very handy to log information in javascript .
sample code
<script type="text/javascript" src=""></script>
$(document).ready(function() {
console.log('current value is prashant gupta');'this is information')
console.warn('this is warning')
console.error('this is error.')
console.debug('this is debug.')


what you need to do is
1. just include the jquery file in your code
<script type="text/javascript" src=""></script>
2. and now you can use
for loggin.

How to see the logged statement:
to check javascript logs , I uses Firebug extension in Mozilla.
just see below image how it is easy to see your logs in firebug.......