An interesting problem is to inspect unknown objects in javascript. Found a good example of how to do it here . Just to rehash in case the site move: function inspect(obj, maxLevels, level) { var str = '', type, msg; // Start Input Validations // Don't touch, we start iterating at level zero if(level == null) level = 0; // At least you want to show the first level if(maxLevels == null) maxLevels = 1; if(maxLevels < 1) return '<font color="red">Error: Levels number must be > 0</font>'; // We start with a non null object if(obj == null) return '<font color="red">Error: Object <b>NULL</b></font>'; // End Input Validations // Each Iteration must be indented str += '<ul>'; // Start iterations for all objects in obj for(property in obj) { try { // Show "property" and "type property" typ
Blog by abdza. Open Source, Computers, Gadgets, Life, Love and everything in between.