A few questions:
1. first line in function, to debug should display the calling parameter?
says parm = without a value, crlf is executed
2. when i uncomment the recursive line caller i get a second parm = , so the
function calls itself, and stops
the error is object doesnt support this property or method
2a. how can i know programmatically what is supported?
2b. is there some sort of error trap so the rest of the function can continue
to display the (working) rest?
3. Is it possible to bump the array into a new array with numeric indexes?
If so, the .length of each item would be available which would make things
easier
Again, thanks for your time and effort.
Thanks Jake I made a few additions to your code. See that addition of
var before the i. Without the var, i is a global variable. ( I left
out the var i in my object debug routine once too. )
For some reason, IE managed to come up with an error in for (var i in p)
when I did this. Do not know how. I added the try statement. I assume
this was causing the problem, but I now think it was the var i.
I know the differences in style. I copied some stuff.
I tired this in IE 5.2 for MacOS. I didn't try the posted version in
Netscape 7.1, but an earlier version took forever to run.
Robert
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<HEAD>
<script type="text/javascript">
function show(p) {
document.write('<br>parm = ' + p + '<br>');
for (var i in p) {
try
{
document.write(
" "
+ i +' : '
+' ('
+ typeof p
+ ') '
+ p );
}
catch(e)
{
document.write("... Error writing out structure. Was " +
p + " of " + i);
}
if (typeof p == 'object') {
show(p);
}
else {
document.write('<br>');
}
}
}
</script>
</head>
<body>
<script type="text/javascript">
// document.write(navigator.plugins.length);
show(navigator);
document.write("<br>Show the document<br>");
show(document);
</script>
</body>