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
Highlighted
New Member
Posts: 2
Registered: ‎09-04-2013
My Device: Bold 9300
My Carrier: Idea
Accepted Solution

Phonegap Blackberry App fails on ajax calls, gives 500 Internal Server Error

Hi All, I have developed an application which post an ajax call to the server aspx page.

 

The call fails when I am triggering it through Public IP address, but same works fine when triggered through a Local IP address.

 

The aspx page works fine when called through the browser, the issue is when ajax call is made from the app.

 

Everything works fine on Android and iOS versions Apps with the same code.

 

Also the config file has access origin set to all (*)

 

$.ajax({

url:LINK TO THE ASPX PAGE,

type: "POST",

processData:true,

data:{params},

crossDomain: true,

error: function(result)

{ alert(result.status + " " + result.statusText); },

success:

function(data) { alert("sucess"); }, });

 

Please Help, Thanks

Contributor
Posts: 14
Registered: ‎04-26-2012
My Device: storm2 9550
My Carrier: software developer

Re: Phonegap Blackberry App fails on ajax calls, gives 500 Internal Server Error

You will need to give the phonegap api an access to the uri u are posting to in your config.xml

e.g

<access subdomains="true" uri="http://www.google.com" />

 

------------------------------------------------------------------------------------------------------------------------------------------------------

Dont forget to hit the Like button as Accept as solution to help others if this post helps 

New Member
Posts: 2
Registered: ‎09-04-2013
My Device: Bold 9300
My Carrier: Idea

Re: Phonegap Blackberry App fails on ajax calls, gives 500 Internal Server Error

Yes I have provided access permission as

 

<access uri="*" />

 

I think it shoud allow all URL's

 

Is subdomains="true" neccessary, as I am not using any subdomains.

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Phonegap Blackberry App fails on ajax calls, gives 500 Internal Server Error

<access uri="*" /> won't whitelist all URLs for Ajax calls; domains accessed via Ajax need to be explicitly white-listed.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.