Click to See Complete Forum and Search --> : Dynamic property evaluation


Duncan
12-18-2002, 03:09 AM
I've seen how to loop through an object's properties using:

for (property in object)
{
}

What I would like to do is extract the value of that property.

for (property in object)
{
alert ("object." + property + ": " + object.(property));
}

What is the appropriate syntax for property value evaluation?
The part I'm wondering about is the object.(property) bit.

swon
12-18-2002, 03:15 AM
See some tutorials at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods.asp

Charles
12-18-2002, 04:20 AM
<pre>
<script type="text/javascript">
<!--
for (param in document) {document.writeln(param, ':', document[param])};
// -->
</script>
</pre>

Duncan
12-18-2002, 05:02 AM
Awesome. Thank you Charles. That was exactly what I needed.

Swon, thank you too. Though the page you directed me to didn't help me solve the problem I was facing, I found it to be a great resource, and it really helped me out with some other problems I was having.

So, do you know how to get rid of the internal bevel presented in ie6 when displaying an iframe?