"Jake" <me@home.com> wrote in message news:<NN********************@hebe.telenet-ops.be>...
Hi Richard,
This thread has been going for a while, so here is the function
It gets stuck when the function accesses typeof navigator.plugins
For some reason in the Winodows 98 version of IE, the statement for
(var i in p) is generating invalid values in variable i. Do not know
the story. I have coded up a workaround.
For testing javascript programs, I recommend using a Gecko based
browser like Netscape 7.1.
Example code follows.
I have not tried all the error paths.
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>');
document.write('typeof p = ' + typeof p + '<br>');
if (typeof p == 'object' ) {
try {
for (var i in p) {
try {
document.write(
" "
+ i +' : '
+' ('
+ typeof p[i]
+ ') '
+ p[i] );
}
catch(e) {
document.write("... Error writing out structure. Was " +
p + " of " + i);
}
if (typeof p[i] == 'object') {
document.write("<br>[] i = " + i);
show(p[i]);
}
else {
document.write('<br>');
}
} // of for loop
} // of try for for statement
catch(e) {
document.write("<br>... for loop control problem. IE seems " +
"prone to these problems. e = " + e + "<br>");
}
} // of is object if
else {
document.write("... Error. Function expects an object " +
"but didn't get an object.");
document.write('typeof p = ' + typeof p + '<br>');
}
} // of function
</script>
</head>
<body>
<script type="text/javascript">
// document.write(navigator.plugins.length);
show(navigator);
//document.write("<br><br><br>Show the document<br>");
// show(document);
</script>
</body>