Development Environment

Development tips: JavaScript debugger statement

According with the MDC the debugger statement was introduced in ECMA-262, Edition 5

Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.

This statement is very handy when trying to debug eval’ed code like the View definition in Openbravo 3.0. It seems the only way to have an entry point to the JavaScript program running in the browser.

I’ve tested this statement in Internet Explorer 8, Firefox 4b10 and Chrome 9. And works when you have a debugger running. Note: In Firefox you need Firebug available for that page.

<script type="text/javascript">
function f() {
 var message = 'hello world';
 if(typeof window.console !== 'undefined') {
 else {

Here you have some screenshots:

Internet Explorer
Internet Explorer - JS debugger

Firefox/Firebug - JS debugger

Chrome/Chromium - JS debugger

Previous post

A Great Community Contribution: Linked Items

Next post

About About

No Comment

Leave a reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>