Skip to content

Display all object properties tree in browser console. Helpful when debugging on older browsers such as IE8, as well as hybrid mobile dev tools.

License

Notifications You must be signed in to change notification settings

isteven/obreaker-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obreaker.js

A small script which traverse and print object properties recursively to your web browser console. Very helpful when debugging, especially on older browsers such as IE8.

Screenshot

Demo: http://jsfiddle.net/T69b3/1/ or download all the files into a same folder and open obreaker.htm.

Features

  • Print everything. Expression, string, object, array.. all in one liner!
  • Different closures, [ ] for array and { } for object so you can easily differentiate them
  • Set how deep you would like to traverse the object. Default is 999.

Usage

Include obreaker.js, such as

<html>
    <head>
        <script src="obreaker.js"></script>
        ...
    </head>
    ...

and use it like this:

obreaker.log( 'hello world!', 'my host is: ' , window.location.host );

Basically it's similar with console.log.

Note

  1. On Firebug's console, it displays function name & line number of the caler properly. But it simply display the obreaker.js on Chrome's and/or IE's console.
    2) It will loop non-stop recursively on JQuery objects and/or AngularJs scope objects, so if you really need to loop them, set the traverse depth to 1 and go level by level -while specifying which variable to go next-, or use normal console.log().

Browser Compatibility

Tested on:

  • Opera 12.16 (Yes, I love Opera browser! Download yours here: http://www.opera.com/)
  • IE8 (IE8 is the default browser in the company I work for)
  • Firefox 27
  • Google Chrome 33

Licence

Released under the MIT license.

About

Display all object properties tree in browser console. Helpful when debugging on older browsers such as IE8, as well as hybrid mobile dev tools.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published