Welcome!

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

Reply
Contributor
Posts: 22
Registered: ‎05-06-2011
My Device: torch 9800
My Carrier: at&t

jQuery and Json support

I have a mobile web app that runs successfully on iOS.  It uses javascript and jquery calls via json through $.getJSON().  On my Torch these calls never get returned.

 

Is there some option somewhere on the device to allow it to make json calls? I have javascript turned on, no popup blocking and no restrictions that I am aware of in the browser settings.

Developer
Posts: 47
Registered: ‎04-26-2011
My Device: Curve 2 8530 and PlayBook (soon)
My Carrier: Verizon

Re: jQuery and Json support

@aesculus:  I am writing an app that uses JQuery, JSON, CSS, and HTML5 in Eclipse and WebWorks and the calls work just fine.    What is the architecture of your application?



My Blog: DevGuy.org
My Apps: Dive Planner
1. Please give Kudos by clicking the Kudos star kudos star below the post that helped you..
2. Please resolve your thread by marking the post "Solution?" that solved your issue.

Contributor
Posts: 22
Registered: ‎05-06-2011
My Device: torch 9800
My Carrier: at&t

Re: jQuery and Json support

[ Edited ]

The same except I also use jqTouch and am not using a framework like eclipse.  Doing it all by hand. My back end is PHP and returns json.

 

Is there any js libraries that have to be added for the BlackBerry to support json? I looked around and did not see any.

Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: jQuery and Json support

Have you tried the tools from the inventor of JSON himself?

 

https://github.com/douglascrockford/JSON-js

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 47
Registered: ‎04-26-2011
My Device: Curve 2 8530 and PlayBook (soon)
My Carrier: Verizon

Re: jQuery and Json support

There aren't any as far as I have seen.  However, there may be something as far as the WebWorks SDK is concerned.  My suggestion (just to rule it out) is to setup the free WebWorks SDK on your machine and try something simple that uses JQuery to send and/or receive JSON.  You can find the steps I used to set up WebWorks here if you need them and of course this little company called Research In Motion has fabulous instructions located here. Smiley Very Happy



My Blog: DevGuy.org
My Apps: Dive Planner
1. Please give Kudos by clicking the Kudos star kudos star below the post that helped you..
2. Please resolve your thread by marking the post "Solution?" that solved your issue.

Contributor
Posts: 22
Registered: ‎05-06-2011
My Device: torch 9800
My Carrier: at&t

Re: jQuery and Json support

Can you look at the final execution file of your BlackBerry application (the index.html file) and see what source libraries Eclipse may have added from the WebWorks SDK?

 

For example for jquery I added:

<script src="js/jquery.1.4.2.js" type="text/javascript" charset="utf-8"></script>

 

I am thinking the SDK may add other features to support the browser that are not native.

Contributor
Posts: 22
Registered: ‎05-06-2011
My Device: torch 9800
My Carrier: at&t

Re: jQuery and Json support

jquery and json are not the problem. It works in every other platform and os other than the blackberry OS6.

Developer
Posts: 47
Registered: ‎04-26-2011
My Device: Curve 2 8530 and PlayBook (soon)
My Carrier: Verizon

Re: jQuery and Json support

It appears as though others may have had similar issues on OS5.  You can view the thread here.  It will be interesting to see what may be causing this.

 

 



My Blog: DevGuy.org
My Apps: Dive Planner
1. Please give Kudos by clicking the Kudos star kudos star below the post that helped you..
2. Please resolve your thread by marking the post "Solution?" that solved your issue.

Highlighted
Contributor
Posts: 22
Registered: ‎05-06-2011
My Device: torch 9800
My Carrier: at&t

Re: jQuery and Json support

I  think its the same problem and thanks for the link. My server is on the same domain but it does turn around and talk to other servers so maybe it is a problem. I would have suspected the cross domain piece would have been hidden from the BB.

 

And after looking at some of my code json is working OK. Its the cross domain calls from the server that is being blocked.