you don't have to use list.each


this is similar to for(var i = 0; ...) loop, but you iterate directly
on the object property which should be faster than list.each.




On 30 déc, 16:37, tbela99 <[email protected]> wrote:
> for(prop in object) if(object.hasOwnProperty(prop)) {
>
>    //alert(typeof object[prop]);
>
> }
>
> object.hasOwnProperty is true if the property is not inherited.
>
> that's all you need
>
> On 30 déc, 08:42, websam <[email protected]> wrote:
>
> > Hello,
>
> > I'm making a class to create a table and fill that table with data
> > from JSON. But I can't find a way to loop throug my JSON object
> > without hardcoding the key/value pair.
>
> > My JSON looks like this :
>
> > {"d":[
> >     {"Id":1,"RoleName":"Master","AddDate":"10-08-2008
> > 21:28:23","Active":false},
> >     {"Id":2,"RoleName":"Administrator","AddDate":"10-08-2008
> > 23:46:13","Active":true},
> >     {"Id":3,"RoleName":"SuperUser","AddDate":"11-08-2008
> > 09:41:49","Active":true},
> >     {"Id":4,"RoleName":"User","AddDate":"10-08-2008
> > 23:16:44","Active":true}
> > ]}
>
> > How can I loop through this without knowing the key's Id, RoleName,
> > ect. ?
>
> > /Websam

Reply via email to