anyone see where this thing if fouling up? it's supposed to loop through the properties of an object, and print them out in a sorted list. i thought it would be good for debugging purposes, but there are, ironically, a seeming multitude of bugs in it.
Code:
<html> <script> function objProps(objekt, objParent) { var temp = '<OL>', ray = new Array(), i; for (i in objekt) { if ( objekt[i] == self.history) { continue; } if ((typeof objekt[i] == "object") && (objekt[i] != objParent)) { ray[ray.length] = "<LI>" + i + ": " + objProps(objekt[i], objekt); } else { ray[ray.length] = "<LI>" + i + ": " + objekt[i]; } } ray.sort(); temp += ray.join('</LI>') + '</OL>'; alert(temp); return temp; } document.write(objProps(document,self)); </script> </html>
Comment