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 Developer
Posts: 2
Registered: ‎12-30-2010
My Device: Not Specified

Issue using Ajax and Webworks

When i am trying to post to a website to get the results back i keep getting this error in the console:

 

webworks.handset :: XMLHttpRequest :: setRequestHeader does not work with JSONP.

 

What do i do to fix this?

Contributor
Posts: 16
Registered: ‎08-01-2013
My Device: Bold 9900
My Carrier: Vodacom

Re: Issue using Ajax and Webworks

I have the same problem... On webservices that previously worked perfectly... :'(

Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Issue using Ajax and Webworks

Try a CORS header

 

In PHP it looks like this...

 

header("Content-Type: text/javascript");
header('Access-Control-Allow-Origin: *');
header_remove("Set-Cookie");
echo $payload;

 

This is the CORS for JSON which is usually what's required and $payload if the JSON to return

 

Change the mimetype to text/xml if yuor $payload is XML

 

 




Click the like button if you find my posts useful!
Contributor
Posts: 16
Registered: ‎08-01-2013
My Device: Bold 9900
My Carrier: Vodacom

Re: Issue using Ajax and Webworks

Hi. I would like to point out that I solved my own issue. What I did is go through my ripple settings and set cross domain proxy to disabled. Smiley Happy Hope this helps someone else

Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Issue using Ajax and Webworks

Oh - soz wrong end of the stick

 

Ripple has an option to completely disable this stuff

 

Use it carefully

 

Erik - where is it again?




Click the like button if you find my posts useful!
Contributor
Posts: 16
Registered: ‎08-01-2013
My Device: Bold 9900
My Carrier: Vodacom

Re: Issue using Ajax and Webworks

In Settings -> cross domain proxy. i just set that to disabled. My webservice calls are working 100% now