[Firebug] Console clever nutzen
Posted by skoch on 6. Mai 2010Mit dem Firebug lassen sich super Objekte und Debug-Informationen anzeigen. Ganz einfach mit:
console.log ( object ); console.log ( 'Hallo Welt' );
Damit diese Ausgaben nicht zu Fehlern führen, wenn man den Firebug mal ausgeschaltet hat, einfach dieses Script am Anfang der Seite platzieren:
try
{
console.log ( 'init debug' );
} catch ( e )
{
console = { log: function ( txt ) { /*throw new Error ( txt )*/ } };
}
Leave a Reply
You must be logged in to post a comment.