Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 8
Registered: ‎01-16-2011
My Device: Blackberry 9700
My Carrier: Etisalat

Parsing Array/List with jSON using WebWorks

I need you help guys,

ive tried this example here and it worked like a charm "Thanks for it, it saved me a lot of time". I modified it a little and now i can access my MSSQL DB using .Net web service. I successfully updated the DB with some data " Username, password,email...etc" from my BB to the DB using web service. Now here is my problem, i'm trying to retrieve all the Username from DB to display them in a <div> tag but its not working and throwing this error code

TypeError: Cannot convert 'undefined' to an object.
	Running  at line  180: stack.unshift(cont[key||cont.length]={});.
	Called from line   21: var car=jsonParse(jsonString);.


However, when i insert an Alert(), it shows me the whole users in the alert dialog. What i believe is that


var car = jsonParse(jsonString);



is causing this error since it parsing only a single object.


Please help me on this.


Thank you.

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Parsing Array/List with jSON using WebWorks

Many JavaScript based JSON parsers require very strict JSON syntax.  Are you 100% sure that your syntax that you are returning from the web server is syntactically correct?



Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter