You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.
Hi there
Love the toolkit, thanks a million for making it available. I'm using the
Blackberry version in a Widget I'm creating and have a query regarding parsing
multiple results:
Say for example we have a json string being returned as:
{ {"id":"1","title":"row 1"} , {"id":"2","title":"row 2"} }
When I run it through jsonParse I try to access each position of results as if
it were an array (as I saw mentioned on another issue of a similar nature):
var events = jsonParse(result);
alert(events[0].id);
and to see how many results have been returned:
alert(events.length);
but each of these returns "undefined".
I realise I'm probably doing something really dumb or missing an obvious
solution but at the moment I'm stumped. Note that in my specific case, using
the "for(var x in y)" approach will not fit in to my code.
Any thoughts?
Cheers
Lee
Original issue reported on code.google.com by lsibbald...@gmail.com on 3 Jul 2010 at 1:52
The text was updated successfully, but these errors were encountered:
Hi
I've since figured out that it was the structure of the json that was causing
me problems.
Changing the above json sample to:
[ {"id":"1","title":"row 1"} , {"id":"2","title":"row 2"} ]
(note square enclosing brackets rather than curlies) successfully creates an
object which can be checked by using
events.length
and I can also then use
events[0].id
to access the object properties.
Apologies for raising this as an issue.
Original comment by lsibbald...@gmail.com on 4 Jul 2010 at 10:52
Original issue reported on code.google.com by
lsibbald...@gmail.com
on 3 Jul 2010 at 1:52The text was updated successfully, but these errors were encountered: