Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Javascript / Client Side Development

list an object's properties


how can I do that? I simply want to create a function which will list all
properties of any object which is supplied as an argument to the function
please disregard. After searching for 25 minutes, I found the answer 1
minute after posting my question. C'est la vie. <sigh>

On May 22, 11:03 am, Herb <her@mail.com> wrote:

> how can I do that? I simply want to create a function which will list all
> properties of any object which is supplied as an argument to the function

var o = {}
for(att in o){
alert(o[att]);

On 22 May 2007 10:26:52 -0700, Mister Joe <mrjoefri@gmail.com> wrote:

>On May 22, 11:03 am, Herb <her@mail.com> wrote:
>> how can I do that? I simply want to create a function which will list all
>> properties of any object which is supplied as an argument to the function

>var o = {}

thanks. What's the purpose of the above approach? Why not just do:
var o;

Herb said the following on 5/22/2007 3:14 PM:

> On 22 May 2007 10:26:52 -0700, Mister Joe <mrjoefri@gmail.com> wrote:

>> On May 22, 11:03 am, Herb <her@mail.com> wrote:
>>> how can I do that? I simply want to create a function which will list all
>>> properties of any object which is supplied as an argument to the function

>> var o = {}

> thanks. What's the purpose of the above approach? Why not just do:
> var o;

Test it and see :) There is a difference in the properties a variable
possesses and the ones an Object possesses.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc