debug javascript jQuery

Debug javascript with Chrome tools:

The Chrome WebKit Developer Console lets you view attached events for elements. Right click mouse on element => "Inspect element" (F12) => "Elements" tab => "Event Listeners" section;

Debug javascript visually with extension:

Debug javascript events via code:

<script>
$(function(){
	$('.target').click(function() {
		console.log('.target clicked');
	});
 
	var clickEvents = $('.target').data('events').click;
	jQuery.each(clickEvents, function(key, handlerObj) {
		console.log(handlerObj.handler) // prints "function() { console.log('.target clicked') }"
	})
});
</script>

1 comment on “debug javascript jQuery

Leave a Reply

Your email address will not be published. Required fields are marked *